]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix crash when retrieving window property with invalid atom data
authorPo Lu <luangruo@yahoo.com>
Sat, 2 Apr 2022 12:12:12 +0000 (20:12 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 2 Apr 2022 12:12:12 +0000 (20:12 +0800)
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

index 76a2f9f507594ab395154788ae3d0fec180892a9..7719876884eb9c63de366507294c9e0580b621c3 100644 (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;