From: Po Lu Date: Sat, 2 Apr 2022 12:12:12 +0000 (+0800) Subject: Fix crash when retrieving window property with invalid atom data X-Git-Tag: emacs-29.0.90~1931^2~820 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ca5f259cff93ad7fc4d5e70319412420affb6d17;p=emacs.git Fix crash when retrieving window property with invalid atom data This happens when dropping files from dtfile, which somehow puts non-atom stuff in window properties of type ATOM_PAIR. * src/xselect.c (x_atom_to_symbol): Catch errors around XGetAtomName. --- diff --git a/src/xselect.c b/src/xselect.c index 76a2f9f5075..7719876884e 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -285,7 +285,9 @@ x_atom_to_symbol (struct x_display_info *dpyinfo, Atom atom) return QNULL; block_input (); + x_catch_errors (dpyinfo->display); str = XGetAtomName (dpyinfo->display, atom); + x_uncatch_errors (); unblock_input (); TRACE1 ("XGetAtomName --> %s", str); if (! str) return Qnil;