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.
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... |
maribu
left a comment
There was a problem hiding this comment.
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