From 070ffb787227614fb0e3aec4ffd57a745eb24aac Mon Sep 17 00:00:00 2001 From: jewelcodes Date: Tue, 26 Nov 2024 19:21:34 -0500 Subject: [PATCH] x86_64: null pointer check in signal dispatch --- src/platform/x86_64/ipc/signal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/x86_64/ipc/signal.c b/src/platform/x86_64/ipc/signal.c index 44e8ddd..1b6e697 100644 --- a/src/platform/x86_64/ipc/signal.c +++ b/src/platform/x86_64/ipc/signal.c @@ -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;