Modified per_read_integer to handle a length of 0 (which is seen when older RDP clients connect to the FreeRDP server)

This commit is contained in:
Mike McDonald 2014-09-16 23:15:34 -04:00
parent 2ec493d094
commit 50cf0ee915

View File

@ -198,7 +198,9 @@ BOOL per_read_integer(wStream* s, UINT32* integer)
if (Stream_GetRemainingLength(s) < length)
return FALSE;
if (length == 1)
if (length == 0)
*integer = 0;
else if (length == 1)
Stream_Read_UINT8(s, *integer);
else if (length == 2)
Stream_Read_UINT16_BE(s, *integer);