From ca5f259cff93ad7fc4d5e70319412420affb6d17 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 2 Apr 2022 20:12:12 +0800 Subject: [PATCH] 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. --- src/xselect.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.39.2