From: Po Lu Date: Mon, 16 May 2022 03:05:32 +0000 (+0800) Subject: Improve safety of handling unsupported drop events on X X-Git-Tag: emacs-29.0.90~1910^2~657 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=44e5339e82fa9d92542558cba997cab6d605f59b;p=emacs.git Improve safety of handling unsupported drop events on X * 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. --- diff --git a/src/keyboard.c b/src/keyboard.c index e8f51f8a6fe..6c114986b7e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -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), diff --git a/src/xterm.c b/src/xterm.c index 775b1144341..54edefa3c15 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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),