Added clarifications in freerdp_channel_process

This commit is contained in:
Armin Novak 2020-03-04 14:59:27 +01:00
parent d7ba252cd7
commit 825d63cf0c

View File

@ -139,6 +139,11 @@ BOOL freerdp_channel_process(freerdp* instance, wStream* s, UINT16 channelId, si
if (Stream_GetRemainingLength(s) < 8)
return FALSE;
/* [MS-RDPBCGR] 3.1.5.2.2 Processing of Virtual Channel PDU
* chunked data. Length is the total size of the combined data,
* chunkLength is the actual data received.
* check chunkLength against packetLength, which is the TPKT header size.
*/
Stream_Read_UINT32(s, length);
Stream_Read_UINT32(s, flags);
chunkLength = Stream_GetRemainingLength(s);
@ -150,7 +155,7 @@ BOOL freerdp_channel_process(freerdp* instance, wStream* s, UINT16 channelId, si
}
if (length < chunkLength)
{
WLog_ERR(TAG, "Expected %" PRIu32 " bytes, but only have %" PRIdz, length, chunkLength);
WLog_ERR(TAG, "Expected %" PRIu32 " bytes, but have %" PRIdz, length, chunkLength);
return FALSE;
}
IFCALLRET(instance->ReceiveChannelData, rc, instance, channelId, Stream_Pointer(s), chunkLength,
@ -209,7 +214,7 @@ BOOL freerdp_channel_peer_process(freerdp_peer* client, wStream* s, UINT16 chann
else if (client->ReceiveChannelData)
{
int rc = client->ReceiveChannelData(client, channelId, Stream_Pointer(s), chunkLength,
flags, length);
flags, length);
if (rc < 0)
return FALSE;
}