server/inputs: return NULL on alloc_buf request for too large message

This commit is contained in:
Alon Levy 2010-12-07 12:56:30 +02:00
parent 380b5e9dd7
commit 96da0a4819

View File

@ -157,6 +157,10 @@ static uint8_t *inputs_channel_alloc_msg_rcv_buf(RedChannel *channel, SpiceDataH
{
InputsChannel *inputs_channel = SPICE_CONTAINEROF(channel, InputsChannel, base);
if (msg_header->size > RECEIVE_BUF_SIZE) {
red_printf("error: too large incoming message");
return NULL;
}
return inputs_channel->recv_buf;
}