From 5f3ba52de63229cf1783f93286e102e9d3483101 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 30 Jul 2020 16:16:01 +0200 Subject: [PATCH] Fix #6399: Call ConvertFromUnicode with length -1. The input string has ensured NULL termination, so let the function determine the correct length. (cherry picked from commit 36499527e747283019c21dbc84c5eff0a564e1d8) --- libfreerdp/core/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfreerdp/core/info.c b/libfreerdp/core/info.c index 7fd96b9..3f8afae 100644 --- a/libfreerdp/core/info.c +++ b/libfreerdp/core/info.c @@ -496,7 +496,7 @@ static BOOL rdp_read_info_string(UINT32 flags, wStream* s, size_t cbLenNonNull, if (unicode) { - if (ConvertFromUnicode(CP_UTF8, 0, domain, cbLenNonNull, &ret, 0, NULL, NULL) < 1) + if (ConvertFromUnicode(CP_UTF8, 0, domain, -1, &ret, 0, NULL, NULL) < 1) { WLog_ERR(TAG, "failed to convert Domain string"); return FALSE; -- 2.7.4