From 9886e94d9b52c03e63d147ec58bd90e183c8f7be Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 5 Oct 2020 16:08:28 +0200 Subject: [PATCH] Correctly clear out output UTF-16 buffer Each character is more than one byte, so adjust the clearing of the buffer to reflect that. --- common/rfb/util.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/rfb/util.cxx b/common/rfb/util.cxx index ecab8485..649eb0ba 100644 --- a/common/rfb/util.cxx +++ b/common/rfb/util.cxx @@ -530,7 +530,7 @@ namespace rfb { // Alloc buffer = new wchar_t[sz]; - memset(buffer, 0, sz); + memset(buffer, 0, sz * sizeof(wchar_t)); // And convert out = buffer; -- 2.39.5