core: Correct handling of MultifragMaxRequestSize (Fixes #1022)

This commit is contained in:
Martin Fleisz 2013-03-06 13:33:09 +01:00
parent 2e8a0983dd
commit a0de1b18bd
2 changed files with 5 additions and 2 deletions

View File

@ -2190,10 +2190,13 @@ BOOL rdp_print_desktop_composition_capability_set(STREAM* s, UINT16 length)
BOOL rdp_read_multifragment_update_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
UINT32 multifragMaxRequestSize;
if (length < 8)
return FALSE;
stream_read_UINT32(s, settings->MultifragMaxRequestSize); /* MaxRequestSize (4 bytes) */
stream_read_UINT32(s, multifragMaxRequestSize); /* MaxRequestSize (4 bytes) */
if (settings->MultifragMaxRequestSize < multifragMaxRequestSize)
settings->MultifragMaxRequestSize = multifragMaxRequestSize;
return TRUE;
}

View File

@ -340,7 +340,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, STREAM* s)
stream_check_size(fastpath->updateData, size);
stream_copy(fastpath->updateData, comp_stream, size);
if (stream_get_size(fastpath->updateData) > rdp->settings->MultifragMaxRequestSize)
if (stream_get_length(fastpath->updateData) > rdp->settings->MultifragMaxRequestSize)
{
printf("fastpath PDU is bigger than MultifragMaxRequestSize\n");
return -1;