From 264d19765c6fb2ea3c32b2d6fba23719add6fce4 Mon Sep 17 00:00:00 2001 From: Pascal Nowack Date: Thu, 27 Apr 2023 10:43:36 +0200 Subject: [PATCH] core/server: Use correct size for DVC data PDUs The VirtualChannelChunkSize setting refers to the VCChunkSize for static channels and not to the maximum size for DVC data PDUs. DVC data PDUs are according to [MS-RDPEDYC] always limited to 1600 Bytes. --- libfreerdp/core/server.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libfreerdp/core/server.c b/libfreerdp/core/server.c index b0cde3c86..1110aee51 100644 --- a/libfreerdp/core/server.c +++ b/libfreerdp/core/server.c @@ -49,6 +49,8 @@ } while (0) #endif +#define DVC_MAX_DATA_PDU_SIZE 1600 + typedef struct { UINT16 channelId; @@ -1578,12 +1580,9 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelWrite(HANDLE hChannelHandle, PCHAR Buffer, WINPR_ASSERT(channel->client); context = channel->client->context; WINPR_ASSERT(context); - WINPR_ASSERT(context->settings); while (Length > 0) { - const UINT32 VirtualChannelChunkSize = - freerdp_settings_get_uint32(context->settings, FreeRDP_VirtualChannelChunkSize); - s = Stream_New(NULL, VirtualChannelChunkSize); + s = Stream_New(NULL, DVC_MAX_DATA_PDU_SIZE); if (!s) {