Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Novak <anovak@thincast.com>2023-12-16 20:00:03 +0300
committerArmin Novak <anovak@thincast.com>2023-12-16 20:00:19 +0300
commit94db9006db34a2e3e9c03ae36d55d07fc1fe1739 (patch)
treefad19167e316af7df0d6c51c559bd10026f8a9cf
parentcb67d015c3370ef64bca80591fdf8fc096a5847a (diff)
fixed length of clipboard string
include '\0' terminator
-rw-r--r--plugins/rdp/rdp_cliprdr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/rdp/rdp_cliprdr.c b/plugins/rdp/rdp_cliprdr.c
index 0a847f45d..668d9035a 100644
--- a/plugins/rdp/rdp_cliprdr.c
+++ b/plugins/rdp/rdp_cliprdr.c
@@ -855,7 +855,7 @@ void remmina_rdp_cliprdr_get_clipboard_data(RemminaProtocolWidget *gp, RemminaPl
#if FREERDP_VERSION_MAJOR >= 3
size_t len = 0;
outbuf_wchar = ConvertUtf8NToWCharAlloc((const char *)inbuf, (size_t)size, &len);
- size = len * sizeof(WCHAR);
+ size = (len + 1) * sizeof(WCHAR);
#else
const int rc = (ConvertToUnicode(CP_UTF8, 0, (CHAR *)inbuf, -1, (WCHAR **)&outbuf, 0)) * sizeof(WCHAR);
size = 0;