From ec68b1f2a5df20d1ba212cda6e3909c8b802872c Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 8 Dec 2022 10:36:16 +0100 Subject: [PATCH] [channels,rdpdr] fix computer name sending The name should be '\0' terminated. --- channels/rdpdr/client/rdpdr_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/channels/rdpdr/client/rdpdr_main.c b/channels/rdpdr/client/rdpdr_main.c index aabe3ab3e..a489c196a 100644 --- a/channels/rdpdr/client/rdpdr_main.c +++ b/channels/rdpdr/client/rdpdr_main.c @@ -1177,6 +1177,9 @@ static UINT rdpdr_send_client_name_request(rdpdrPlugin* rdpdr) computerNameLenW *= sizeof(WCHAR); WINPR_ASSERT(computerNameLenW >= 0); + if (computerNameLenW > 0) + computerNameLenW += sizeof(WCHAR); // also write '\0' + s = StreamPool_Take(rdpdr->pool, 16U + computerNameLenW); if (!s)