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.
This commit is contained in:
Po Lu 2022-04-02 20:12:12 +08:00
parent f66a47b5bc
commit ca5f259cff

View file

@ -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;