-
Notifications
You must be signed in to change notification settings - Fork 2k
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
core: fix null pointer dereference #19757
Conversation
core/msg.c
Outdated
if (target == NULL) { | ||
DEBUG("msg_reply_int(): target thread %d does not exist\n", m->sender_pid); | ||
return -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.
Hmm, this looks to me like it can only trigger when in violation with the API. E.g. msg_reply_int()
must make sure that the thread to reply to does exists (e.g. in an app where no thread ever exits, this is trivial).
Adding an assert()
here with a comment that msg_reply_int()
can only be used to reply to existing threads could help debugging, though.
@kaspar030 Could we deprecate all the msg*_ist()
functions? IMO apps should migrate to msg_post()
for IRQ to thread communication anyway.
I force-pushed my branch. But the update is not shown here... |
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.
thx for the PR. Please squash :)
Check return values of following functions for null: - thread_get - thread_get_unchecked
bors merge |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Check return values of following functions for null:
Contribution description
Testing procedure
Issues/PRs references