diff --git a/libfreerdp/core/capabilities.c b/libfreerdp/core/capabilities.c index 5cec55fbd..da67ef59b 100644 --- a/libfreerdp/core/capabilities.c +++ b/libfreerdp/core/capabilities.c @@ -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; } diff --git a/libfreerdp/core/fastpath.c b/libfreerdp/core/fastpath.c index f2e67a96b..e37fed785 100644 --- a/libfreerdp/core/fastpath.c +++ b/libfreerdp/core/fastpath.c @@ -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;