From 8099299ab0a959001658f767a9235db2f55953e1 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Mon, 4 Aug 2025 11:25:54 +0100 Subject: [PATCH] Allow for empty UTF8_STRING to be pasted The current code doesn't allow for an empty string to be pasted to the clipboard on the X11 side. This is done by some lock screen programs to prevent information leakage. --- sesman/chansrv/clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sesman/chansrv/clipboard.c b/sesman/chansrv/clipboard.c index ec9ce6af..f2fa792c 100644 --- a/sesman/chansrv/clipboard.c +++ b/sesman/chansrv/clipboard.c @@ -1810,7 +1810,7 @@ clipboard_event_selection_notify(XEvent *xevent) { LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: UTF8_STRING " "data_size %d", data_size); - if ((g_clip_s2c.incr_in_progress == 0) && (data_size > 0)) + if ((g_clip_s2c.incr_in_progress == 0) && (data_size >= 0)) { g_free(g_clip_s2c.data); g_clip_s2c.total_bytes = data_size;