core: Corrected handling of MultifragMaxRequestSize (Fixes #1022)

This commit is contained in:
Martin Fleisz 2013-03-06 13:40:34 +01:00
parent 28f69ac0a3
commit bba8124fd1
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) BOOL rdp_read_multifragment_update_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{ {
UINT32 multifragMaxRequestSize;
if (length < 8) if (length < 8)
return FALSE; 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; 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_check_size(fastpath->updateData, size);
stream_copy(fastpath->updateData, comp_stream, 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"); printf("fastpath PDU is bigger than MultifragMaxRequestSize\n");
return -1; return -1;