Commit c14e6c05 authored by Jonas Termansen's avatar Jonas Termansen

Fix waitpid(2) when the status pointer is NULL.

parent f744e80b
......@@ -518,7 +518,9 @@ pid_t sys_waitpid(pid_t pid, int* user_status, int options)
{
int status = 0;
pid_t ret = CurrentProcess()->Wait(pid, &status, options);
if ( 0 < ret && !CopyToUser(user_status, &status, sizeof(status)) )
if ( 0 < ret &&
user_status &&
!CopyToUser(user_status, &status, sizeof(status)) )
return -1;
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment