kernel: receive_data and send_data can be called with a NULL buffer.
Change-Id: Id2ac496524ad91f2830e8af12925e0e40ca9ab80 Reviewed-on: https://review.haiku-os.org/c/1333 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
03ed26b691
commit
633fbcf423
@ -3665,7 +3665,7 @@ status_t
|
||||
_user_send_data(thread_id thread, int32 code, const void *buffer,
|
||||
size_t bufferSize)
|
||||
{
|
||||
if (!IS_USER_ADDRESS(buffer))
|
||||
if (buffer != NULL && !IS_USER_ADDRESS(buffer))
|
||||
return B_BAD_ADDRESS;
|
||||
|
||||
return send_data_etc(thread, code, buffer, bufferSize,
|
||||
@ -3681,8 +3681,9 @@ _user_receive_data(thread_id *_userSender, void *buffer, size_t bufferSize)
|
||||
status_t code;
|
||||
|
||||
if ((!IS_USER_ADDRESS(_userSender) && _userSender != NULL)
|
||||
|| !IS_USER_ADDRESS(buffer))
|
||||
|| (!IS_USER_ADDRESS(buffer) && buffer != NULL)) {
|
||||
return B_BAD_ADDRESS;
|
||||
}
|
||||
|
||||
code = receive_data_etc(&sender, buffer, bufferSize, B_KILL_CAN_INTERRUPT);
|
||||
// supports userland buffers
|
||||
|
Loading…
Reference in New Issue
Block a user