]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve safety of handling unsupported drop events on X
authorPo Lu <luangruo@yahoo.com>
Mon, 16 May 2022 03:05:32 +0000 (11:05 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 16 May 2022 03:05:32 +0000 (11:05 +0800)
* src/keyboard.c (kbd_buffer_get_event):
* src/xterm.c (handle_one_xevent): Check that the event frame is
still live after calling arbitrary Lisp code.

src/keyboard.c
src/xterm.c

index e8f51f8a6feaaf21deb09e1ce27683319b4b5571..6c114986b7e473546efb7fe8b93fbd02a7f53f33 100644 (file)
@@ -4041,6 +4041,11 @@ kbd_buffer_get_event (KBOARD **kbp,
                break;
            }
 
+         /* `x-dnd-unsupported-drop-function' could have deleted the
+            event frame.  */
+         if (!FRAME_LIVE_P (f))
+           break;
+
          x_dnd_do_unsupported_drop (FRAME_DISPLAY_INFO (f),
                                     event->ie.frame_or_window,
                                     XCAR (event->ie.arg),
index 775b1144341eab829c4990db0e8f03dc72f9c53f..54edefa3c151efec218fda5b608c6e1083ace8cf 100644 (file)
@@ -10112,6 +10112,11 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
            continue;
        }
 
+      /* `x-dnd-unsupported-drop-function' could have deleted the
+        event frame.  */
+      if (!FRAME_LIVE_P (event_frame))
+       continue;
+
       x_dnd_do_unsupported_drop (FRAME_DISPLAY_INFO (event_frame),
                                 event->ie.frame_or_window,
                                 XCAR (event->ie.arg),