aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-11-08 13:26:40 +0400
committerDmitry Antipov2012-11-08 13:26:40 +0400
commitc66f21eaf103f9ace7400f3d8a06fc34539efca9 (patch)
tree3ae0eaa165b67307d7a40bd4646c7c67b9cefbb5 /src/keyboard.c
parenta43d02f01b7b6cc07f15a0a6ea677669ff079618 (diff)
downloademacs-c66f21eaf103f9ace7400f3d8a06fc34539efca9.tar.gz
emacs-c66f21eaf103f9ace7400f3d8a06fc34539efca9.zip
* 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.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index dfd4d0c2648..8f3a206139d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3416,13 +3416,20 @@ int stop_character EXTERNALLY_VISIBLE;
3416static KBOARD * 3416static KBOARD *
3417event_to_kboard (struct input_event *event) 3417event_to_kboard (struct input_event *event)
3418{ 3418{
3419 Lisp_Object obj = event->frame_or_window; 3419 /* Not applicable for these special events. */
3420 /* There are some events that set this field to nil or string. */ 3420 if (event->kind == SELECTION_REQUEST_EVENT
3421 if (WINDOWP (obj)) 3421 || event->kind == SELECTION_CLEAR_EVENT)
3422 obj = WINDOW_FRAME (XWINDOW (obj)); 3422 return NULL;
3423 /* Also ignore dead frames here. */ 3423 else
3424 return ((FRAMEP (obj) && FRAME_LIVE_P (XFRAME (obj))) 3424 {
3425 ? FRAME_KBOARD (XFRAME (obj)) : NULL); 3425 Lisp_Object obj = event->frame_or_window;
3426 /* There are some events that set this field to nil or string. */
3427 if (WINDOWP (obj))
3428 obj = WINDOW_FRAME (XWINDOW (obj));
3429 /* Also ignore dead frames here. */
3430 return ((FRAMEP (obj) && FRAME_LIVE_P (XFRAME (obj)))
3431 ? FRAME_KBOARD (XFRAME (obj)) : NULL);
3432 }
3426} 3433}
3427 3434
3428#ifdef subprocesses 3435#ifdef subprocesses