Skip to content

Commit

Permalink
add check for tag range
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglimingcn committed Apr 19, 2024
1 parent 7debc56 commit 4903094
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bthread/bthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ int bthread_setconcurrency_by_tag(int num, bthread_tag_t tag) {
bthread::never_set_bthread_concurrency_by_tag = false;
return 0;
}
if (tag < BTHREAD_TAG_DEFAULT || tag >= FLAGS_task_group_ntags) {
return EPERM;
}
BAIDU_SCOPED_LOCK(bthread::g_task_control_mutex);
auto c = bthread::get_task_control();
if (c == NULL) {
Expand Down

0 comments on commit 4903094

Please sign in to comment.