necouchman commented on a change in pull request #274:
URL: https://github.com/apache/guacamole-server/pull/274#discussion_r419412084



##########
File path: src/protocols/rdp/channels/rdpsnd/rdpsnd.c
##########
@@ -35,11 +35,23 @@ void guac_rdpsnd_process_receive(guac_rdp_common_svc* svc,
     guac_rdpsnd* rdpsnd = (guac_rdpsnd*) svc->data;
     guac_rdpsnd_pdu_header header;
 
+    /* Check that we at least have a header. */
+    if (Stream_GetRemainingLength(input_stream) < 4)
+        return;
+    
     /* Read RDPSND PDU header */
     Stream_Read_UINT8(input_stream, header.message_type);
     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;
+    }

Review comment:
       This area here is causing me a little trouble - for whatever reason, if 
I do this check, sound doesn't work.  Maybe I'm doing some pointer access 
incorrectly or something??




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to