Fixed reading suppress output pdu

Optional rectangle must be read from PDU
This commit is contained in:
Armin Novak 2020-03-03 13:10:24 +01:00
parent d7da4b7e00
commit bda2731035

View File

@ -2139,6 +2139,8 @@ BOOL update_read_refresh_rect(rdpUpdate* update, wStream* s)
BOOL update_read_suppress_output(rdpUpdate* update, wStream* s)
{
RECTANGLE_16* prect = NULL;
RECTANGLE_16 rect = { 0 };
BYTE allowDisplayUpdates;
if (Stream_GetRemainingLength(s) < 4)
@ -2147,12 +2149,20 @@ BOOL update_read_suppress_output(rdpUpdate* update, wStream* s)
Stream_Read_UINT8(s, allowDisplayUpdates);
Stream_Seek(s, 3); /* pad3Octects */
if (allowDisplayUpdates > 0 && Stream_GetRemainingLength(s) < 8)
return FALSE;
if (allowDisplayUpdates > 0)
{
if (Stream_GetRemainingLength(s) < sizeof(RECTANGLE_16))
return FALSE;
Stream_Read_UINT16(s, rect.left);
Stream_Read_UINT16(s, rect.top);
Stream_Read_UINT16(s, rect.right);
Stream_Read_UINT16(s, rect.bottom);
prect = &rect;
}
if (update->context->settings->SuppressOutput)
IFCALL(update->SuppressOutput, update->context, allowDisplayUpdates,
allowDisplayUpdates > 0 ? (RECTANGLE_16*)Stream_Pointer(s) : NULL);
IFCALL(update->SuppressOutput, update->context, allowDisplayUpdates, prect);
else
WLog_Print(update->log, WLOG_WARN, "ignoring suppress output request from client");