Skip to content

Commit

Permalink
x86_64: null pointer check in signal dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Nov 27, 2024
1 parent cd5faa9 commit 070ffb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/platform/x86_64/ipc/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ int platformSendSignal(Thread *sender, Thread *dest, int signum, uintptr_t handl

siginfo_t *siginfo = (siginfo_t *) dest->siginfo;
siginfo->si_signo = signum;
siginfo->si_pid = sender->tid;
if(sender) siginfo->si_pid = sender->tid;
else siginfo->si_pid = 0; // we will use pid 0 for the kernel

if(p) siginfo->si_uid = p->user;
else siginfo->si_uid = 0;
Expand Down

0 comments on commit 070ffb7

Please sign in to comment.