Fixed length checks for compressed rdp data.

This commit is contained in:
Armin Novak 2020-03-10 10:52:28 +01:00 committed by akallabeth
parent 297ad536a2
commit 4216646746

View File

@ -869,9 +869,9 @@ int rdp_recv_data_pdu(rdpRdp* rdp, wStream* s)
{
UINT32 DstSize = 0;
BYTE* pDstData = NULL;
UINT32 SrcSize = compressedLength - 18;
UINT16 SrcSize = compressedLength - 18;
if (Stream_GetRemainingLength(s) < (size_t)SrcSize)
if ((compressedLength < 18) || (Stream_GetRemainingLength(s) < SrcSize))
{
WLog_ERR(TAG, "bulk_decompress: not enough bytes for compressedLength %" PRIu16 "",
compressedLength);