From 3700ccbfc8a781dda34f9ba3710a467e3e2c1102 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 10 Jan 2022 09:49:25 +0100 Subject: [PATCH] Fixed #7520: remove trailing '\0' from clipboard data --- client/Wayland/wlf_cliprdr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/Wayland/wlf_cliprdr.c b/client/Wayland/wlf_cliprdr.c index fe7dba3ff..d368e1e85 100644 --- a/client/Wayland/wlf_cliprdr.c +++ b/client/Wayland/wlf_cliprdr.c @@ -723,8 +723,10 @@ wlf_cliprdr_server_format_data_response(CliprdrClientContext* context, if (cnv < 0) return ERROR_INTERNAL_ERROR; - size = (UINT32)cnv; data = cdata; + size = 0; + if (cnv > 0) + size = (UINT32)strnlen(data, (size_t)cnv); break; default: