From 106479d6f27cdd34a8d7dd8e654d890542ab1fcb Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 26 Jan 2016 09:34:22 +0100 Subject: [PATCH] Fixed clientNameLen initialization. --- libfreerdp/core/gateway/rdg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libfreerdp/core/gateway/rdg.c b/libfreerdp/core/gateway/rdg.c index 2ede960..3f3bab8 100644 --- a/libfreerdp/core/gateway/rdg.c +++ b/libfreerdp/core/gateway/rdg.c @@ -200,12 +200,13 @@ BOOL rdg_send_tunnel_authorization(rdpRdg* rdg) BOOL status; WCHAR* clientName = NULL; UINT16 clientNameLen; - UINT32 packetSize = 12 + clientNameLen * 2; + UINT32 packetSize; clientNameLen = ConvertToUnicode(CP_UTF8, 0, rdg->settings->ClientHostname, -1, &clientName, 0); if (!clientName) return FALSE; + packetSize = 12 + clientNameLen * 2 + sizeof(WCHAR); s = Stream_New(NULL, packetSize); if (!s) -- 2.7.4