Commit c66f21ea authored by Dmitry Antipov's avatar Dmitry Antipov

* keyboard.c (event_to_kboard): Do not dereference

frame_or_window field of SELECTION_REQUEST_EVENT
and SELECTION_CLEAR_EVENT events (Bug#12814).
* xterm.h (struct selection_input_event): Adjust comment.
parent a43d02f0
2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
* keyboard.c (event_to_kboard): Do not dereference
frame_or_window field of SELECTION_REQUEST_EVENT
and SELECTION_CLEAR_EVENT events (Bug#12814).
* xterm.h (struct selection_input_event): Adjust comment.
2012-11-07 Eli Zaretskii <eliz@gnu.org>
* w32fns.c (modifier_set): Don't report modifiers from toggle key,
......
......@@ -3416,13 +3416,20 @@ int stop_character EXTERNALLY_VISIBLE;
static KBOARD *
event_to_kboard (struct input_event *event)
{
Lisp_Object obj = event->frame_or_window;
/* There are some events that set this field to nil or string. */
if (WINDOWP (obj))
obj = WINDOW_FRAME (XWINDOW (obj));
/* Also ignore dead frames here. */
return ((FRAMEP (obj) && FRAME_LIVE_P (XFRAME (obj)))
? FRAME_KBOARD (XFRAME (obj)) : NULL);
/* Not applicable for these special events. */
if (event->kind == SELECTION_REQUEST_EVENT
|| event->kind == SELECTION_CLEAR_EVENT)
return NULL;
else
{
Lisp_Object obj = event->frame_or_window;
/* There are some events that set this field to nil or string. */
if (WINDOWP (obj))
obj = WINDOW_FRAME (XWINDOW (obj));
/* Also ignore dead frames here. */
return ((FRAMEP (obj) && FRAME_LIVE_P (XFRAME (obj)))
? FRAME_KBOARD (XFRAME (obj)) : NULL);
}
}
#ifdef subprocesses
......
......@@ -890,10 +890,8 @@ struct scroll_bar
by this structure. */
/* For an event of kind SELECTION_REQUEST_EVENT,
this structure really describes the contents.
**Don't make this struct longer!**
If it overlaps the frame_or_window field of struct input_event,
that will cause GC to crash. */
this structure really describes the contents. */
struct selection_input_event
{
int kind;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment