Unified stream length checks

* Added new function to check for lenght and log
* Replace all usages with this new function
This commit is contained in:
Armin Novak 2022-04-13 11:37:58 +02:00 committed by akallabeth
parent 5306c3ec0a
commit 48a6c0b815

View File

@ -134,11 +134,9 @@ BOOL freerdp_channel_process(freerdp* instance, wStream* s, UINT16 channelId, si
chunkLength);
return FALSE;
}
if (length < chunkLength)
{
WLog_ERR(TAG, "Expected %" PRIu32 " bytes, but have %" PRIdz, length, chunkLength);
if (!Stream_CheckAndLogRequiredLength(TAG, s, length))
return FALSE;
}
IFCALLRET(instance->ReceiveChannelData, rc, instance, channelId, Stream_Pointer(s), chunkLength,
flags, length);
if (!rc)