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



##########
File path: src/protocols/rdp/plugins/guacai/guacai-messages.c
##########
@@ -48,8 +52,9 @@ static void guac_rdp_ai_read_format(wStream* stream,
     Stream_Read_UINT16(stream, format->bps); /* wBitsPerSample */
     Stream_Read_UINT16(stream, format->data_size); /* cbSize */
 
-    /* Read arbitrary data block (if applicable) */
-    if (format->data_size != 0) {
+    /* Read arbitrary data block (if applicable) and data is available. */
+    if (format->data_size != 0
+            && Stream_GetRemainingLength(stream) >= format->data_size) {

Review comment:
       Okay, so maybe change this from a `static void` to `static int` and 
return something non-zero if this happens?




----------------------------------------------------------------
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:
[email protected]


Reply via email to