GUACAMOLE-1059: Move rdpsnd body size check to correct location.

This commit is contained in:
Nick Couchman 2020-05-04 12:11:37 -04:00
parent ce28575b3a
commit 8560ff9718

View File

@ -44,14 +44,6 @@ void guac_rdpsnd_process_receive(guac_rdp_common_svc* svc,
Stream_Seek_UINT8(input_stream);
Stream_Read_UINT16(input_stream, header.body_size);
if (Stream_GetRemainingLength(input_stream) < header.body_size) {
guac_client_log(svc->client, GUAC_LOG_DEBUG, "Not enough bytes in stream."
" Remaining: %d, Body size: %d",
Stream_GetRemainingLength(input_stream),
header.body_size);
return;
}
/*
* If next PDU is SNDWAVE (due to receiving WaveInfo PDU previously),
* ignore the header and parse as a Wave PDU.
@ -60,6 +52,10 @@ void guac_rdpsnd_process_receive(guac_rdp_common_svc* svc,
guac_rdpsnd_wave_handler(svc, input_stream, &header);
return;
}
/* Check body size */
if (Stream_GetRemainingLength(input_stream) < header.body_size)
return;
/* Dispatch message to standard handlers */
switch (header.message_type) {