Kernel: Don't write to stat_loc on SYS_WAIT if it is null

This commit is contained in:
Bananymous 2023-09-29 18:31:44 +03:00
parent 7a5bb6a56b
commit 9fc75fe445
1 changed files with 4 additions and 1 deletions

View File

@ -493,7 +493,10 @@ namespace Kernel
return BAN::Error::from_errno(ECHILD);
pid_t ret = target->pid();
*stat_loc = target->block_until_exit();
int stat = target->block_until_exit();
if (stat_loc)
*stat_loc = stat;
return ret;
}