-
Notifications
You must be signed in to change notification settings - Fork 446
nimble/ll: Add missing NULL pointer check #2038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -920,6 +920,10 @@ ble_ll_sched_rmv_elem_type(uint8_t type, sched_remove_cb_func remove_cb) | |||
OS_ENTER_CRITICAL(sr); | |||
|
|||
first = TAILQ_FIRST(&g_ble_ll_sched_q); | |||
if (!first) { | |||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OS_EXIT_CRITICAL
is missing here
f783be0
to
8cf1a24
Compare
Fix potential NULL dereference that occurs when cancelling extended discovery.
8cf1a24
to
eb23027
Compare
Force pushed to fix missing commit message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we found the same issue #2083 :)
if (first->sched_type == type) { | ||
first_removed = 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that this needs to be fixed as well as first_removed
can be left uninitialized.
Fixes a segmentation fault that occurred when canceling ext discovery.