From 792e23d481ee74e932dd9e19200fce5701753c3c Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Sun, 5 Apr 2020 15:37:33 -0400 Subject: [PATCH] [WIP] Quick stream check fixes. --- src/protocols/rdp/channels/rdpdr/rdpdr-fs-messages.c | 3 ++- src/protocols/rdp/channels/rdpsnd/rdpsnd.c | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/protocols/rdp/channels/rdpdr/rdpdr-fs-messages.c b/src/protocols/rdp/channels/rdpdr/rdpdr-fs-messages.c index fd7ffbd1..0e9581cc 100644 --- a/src/protocols/rdp/channels/rdpdr/rdpdr-fs-messages.c +++ b/src/protocols/rdp/channels/rdpdr/rdpdr-fs-messages.c @@ -441,7 +441,8 @@ void guac_rdpdr_fs_process_query_directory(guac_rdp_common_svc* svc, /* If this is the first query, the path is included after padding */ if (initial_query) { - if (Stream_GetRemainingLength(input_stream) < 23); + if (Stream_GetRemainingLength(input_stream) < 23) + return; Stream_Seek(input_stream, 23); /* Padding */ diff --git a/src/protocols/rdp/channels/rdpsnd/rdpsnd.c b/src/protocols/rdp/channels/rdpsnd/rdpsnd.c index 872357d6..7a468e6a 100644 --- a/src/protocols/rdp/channels/rdpsnd/rdpsnd.c +++ b/src/protocols/rdp/channels/rdpsnd/rdpsnd.c @@ -43,10 +43,6 @@ void guac_rdpsnd_process_receive(guac_rdp_common_svc* svc, Stream_Read_UINT8(input_stream, header.message_type); Stream_Seek_UINT8(input_stream); Stream_Read_UINT16(input_stream, header.body_size); - - /* Check that the body_size actually exists in the input stream. */ - if (Stream_GetRemainingLength(input_stream) < header.body_size) - return; /* * If next PDU is SNDWAVE (due to receiving WaveInfo PDU previously),