xsi_message_queue: Permit incoming buffer to be NULL.

The user address space has not included NULL for a while, so this
has actually been broken for years, and nobody noticed. I guess
XSI message queues are not very well used?

Fixes the in-tree "xsi_msg_queue_test1".
This commit is contained in:
Augustin Cavalier
2023-04-26 17:17:19 -04:00
parent 6acd708e97
commit d8f78afc8a
@@ -494,7 +494,7 @@ _user_xsi_msgctl(int messageQueueID, int command, struct msqid_ds *buffer)
TRACE_ERROR(("xsi_msgctl: message queue id %d not valid\n", messageQueueID));
return EINVAL;
}
if (!IS_USER_ADDRESS(buffer)) {
if (buffer != NULL && !IS_USER_ADDRESS(buffer)) {
TRACE_ERROR(("xsi_msgctl: buffer address is not valid\n"));
return B_BAD_ADDRESS;
}