mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[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:
@@ -39,7 +39,9 @@ mailbox_call(
|
|||||||
|
|
||||||
data.tag = *tag;
|
data.tag = *tag;
|
||||||
data.subtag = *subtag;
|
data.subtag = *subtag;
|
||||||
data.handle = *handle;
|
|
||||||
|
if (handle)
|
||||||
|
data.handle = *handle;
|
||||||
|
|
||||||
j6_status_t s = self->call();
|
j6_status_t s = self->call();
|
||||||
if (s != j6_status_ok)
|
if (s != j6_status_ok)
|
||||||
@@ -47,8 +49,11 @@ mailbox_call(
|
|||||||
|
|
||||||
*tag = data.tag;
|
*tag = data.tag;
|
||||||
*subtag = data.subtag;
|
*subtag = data.subtag;
|
||||||
*handle = data.handle;
|
|
||||||
process::current().add_handle(*handle);
|
if (handle) {
|
||||||
|
*handle = data.handle;
|
||||||
|
process::current().add_handle(*handle);
|
||||||
|
}
|
||||||
|
|
||||||
return j6_status_ok;
|
return j6_status_ok;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user