necouchman commented on a change in pull request #274:
URL: https://github.com/apache/guacamole-server/pull/274#discussion_r420400278
##########
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, I think I got it - have to deal with the availability of the
arbitrary data block separately from checking the Stream for the amount of
data. Once I split that up it works as expected.
----------------------------------------------------------------
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]