From: Po Lu Date: Sun, 19 Jun 2022 05:32:27 +0000 (+0800) Subject: Fix crashes when the _EMACS_DRAG_ATOM is the wrong type X-Git-Tag: emacs-29.0.90~1447^2~1625 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=823b503c9da3d69a369bfeb1c2496cd22933360a;p=emacs.git 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. --- 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);