From 823b503c9da3d69a369bfeb1c2496cd22933360a Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 19 Jun 2022 13:32:27 +0800 Subject: [PATCH] Fix crashes when the _EMACS_DRAG_ATOM is the wrong type * src/xterm.c (xm_get_drag_atom_1): Don't use PropModeAppend if rc != Success. --- src/xterm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index d83a56a6cba..455d5b795e9 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2299,8 +2299,9 @@ xm_get_drag_atom_1 (struct x_display_info *dpyinfo, XChangeProperty (dpyinfo->display, dpyinfo->root_window, dpyinfo->Xatom_EMACS_DRAG_ATOM, XA_ATOM, 32, - (rc == Success && (actual_format != 32 - || actual_type != XA_ATOM) + (rc != Success + || (actual_format != 32 + || actual_type != XA_ATOM) ? PropModeReplace : PropModeAppend), (unsigned char *) &atom, 1); -- 2.39.2