Commit 095204a9 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

server: Return error when hardware message is too large.

So that the client allocates a larger receive buffer when needed and not trigger the assert below when setting the reply message data. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d416f1c4
......@@ -2145,6 +2145,14 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user
clear_bits &= ~get_hardware_msg_bit( msg );
continue;
}
reply->total = msg->data_size;
if (msg->data_size > get_reply_max_size())
{
set_error( STATUS_BUFFER_OVERFLOW );
return 1;
}
/* now we can return it */
if (!msg->unique_id) msg->unique_id = get_unique_id();
reply->type = MSG_HARDWARE;
......
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