[kernel] Check for null handle arg in mailbox_call

The handle argument to `mailbox_call` is optional, so needs to be
manually checked by the syscall handler before dereferencing.
This commit is contained in:
Justin C. Miller
2023-07-10 01:34:19 -07:00
parent 350396d70f
commit 4bceac3d56

View File

@@ -39,6 +39,8 @@ mailbox_call(
data.tag = *tag;
data.subtag = *subtag;
if (handle)
data.handle = *handle;
j6_status_t s = self->call();
@@ -47,8 +49,11 @@ mailbox_call(
*tag = data.tag;
*subtag = data.subtag;
if (handle) {
*handle = data.handle;
process::current().add_handle(*handle);
}
return j6_status_ok;
}