From ac2b13fdcc40d198d51c4a3a70930cc14760de67 Mon Sep 17 00:00:00 2001 From: ilammy Date: Mon, 29 May 2017 00:10:16 +0300 Subject: [PATCH] client/X11: do not fixup HTML data length The data provided by local applications can be actually encoded in UTF-16 (e.g., Firefox does this to HTML). UTF-16 allows embedded null bytes so we should not use strlen() to fix up the data. The HTML format synthesizer can handle trailing null bytes just fine and can detect whether it deals with UTF-8 or UTF-16. --- client/X11/xf_cliprdr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/client/X11/xf_cliprdr.c b/client/X11/xf_cliprdr.c index 47068e95b..557f7cc04 100644 --- a/client/X11/xf_cliprdr.c +++ b/client/X11/xf_cliprdr.c @@ -588,7 +588,6 @@ static void xf_cliprdr_process_requested_data(xfClipboard* clipboard, break; case CB_FORMAT_HTML: - size = strlen((char*) data) + 1; srcFormatId = ClipboardGetFormatId(clipboard->system, "text/html"); break; }