From 84ae1d1cfb96366c9b91cab9dd11533eb32ac0be Mon Sep 17 00:00:00 2001 From: David FORT Date: Wed, 27 May 2015 17:35:25 +0200 Subject: [PATCH] Take in account nfedera's remarks --- libfreerdp/core/gateway/rdg.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libfreerdp/core/gateway/rdg.c b/libfreerdp/core/gateway/rdg.c index 05d79ecca..1154ebf39 100644 --- a/libfreerdp/core/gateway/rdg.c +++ b/libfreerdp/core/gateway/rdg.c @@ -495,7 +495,7 @@ BOOL rdg_process_handshake_response(rdpRdg* rdg, wStream* s) return FALSE; } - if (Stream_GetRemainingLength(s) < 5) + if (Stream_GetRemainingLength(s) < 12) return FALSE; Stream_Seek(s, 8); @@ -547,7 +547,7 @@ BOOL rdg_process_tunnel_authorization_response(rdpRdg* rdg, wStream* s) return FALSE; } - if (Stream_GetRemainingLength(s) < 5) + if (Stream_GetRemainingLength(s) < 12) return FALSE; Stream_Seek(s, 8); @@ -573,7 +573,7 @@ BOOL rdg_process_channel_response(rdpRdg* rdg, wStream* s) return FALSE; } - if (Stream_GetRemainingLength(s) < 5) + if (Stream_GetRemainingLength(s) < 12) return FALSE; Stream_Seek(s, 8); @@ -595,10 +595,11 @@ BOOL rdg_process_packet(rdpRdg* rdg, wStream* s) BOOL status = TRUE; UINT16 type; + Stream_SetPosition(s, 0); + if (Stream_GetRemainingLength(s) < 2) return FALSE; - Stream_SetPosition(s, 0); Stream_Peek_UINT16(s, type); switch (type)