syscalls: waitpid: fix possible null pointer dereference

This commit is contained in:
Matheus
2022-10-26 21:43:46 -03:00
parent e904c89104
commit 1d28e68aa2
+3 -2
View File
@@ -92,8 +92,9 @@ syscallret syscall_waitpid(pid_t pid, int *status, int options){
else{
proc->child = child->sibling;
}
*status = child->status; // XXX safer way of doing this
if(status)
*status = child->status; // XXX safer way of doing this
// the pointer to the last remaining thread is is proc->threads