From eae637ecd36a501b16886434f1a40ac6b3b384c1 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 13 Oct 2006 01:45:37 +0000 Subject: [PATCH] * keymap.c (Fkey_binding): Check Lisp_Object types before doing XCAR and XINT. --- src/ChangeLog | 5 +++++ src/keymap.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 495b55ce41f..30cae45ba84 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-10-12 Chong Yidong + + * keymap.c (Fkey_binding): Check Lisp_Object types before doing + XCAR and XINT. + 2006-10-12 Romain Francoise * image.c (xbm_read_bitmap_data): Delete extra semicolon. diff --git a/src/keymap.c b/src/keymap.c index 1476859ccd5..11e3e348da5 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1610,13 +1610,12 @@ specified buffer position instead of point are used. /* We are not interested in locations without event data */ - if (EVENT_HAS_PARAMETERS (event)) { - Lisp_Object kind; - - kind = EVENT_HEAD_KIND (EVENT_HEAD (event)); - if (EQ (kind, Qmouse_click)) - position = EVENT_START (event); - } + if (EVENT_HAS_PARAMETERS (event)) + { + Lisp_Object kind = EVENT_HEAD_KIND (EVENT_HEAD (event)); + if (CONSP (XCDR (event)) && EQ (kind, Qmouse_click)) + position = EVENT_START (event); + } } /* Key sequences beginning with mouse clicks @@ -1709,7 +1708,8 @@ specified buffer position instead of point are used. pos = XCDR (string); string = XCAR (string); - if (XINT (pos) >= 0 + if (INTEGERP (pos) + && XINT (pos) >= 0 && XINT (pos) < SCHARS (string)) { map = Fget_text_property (pos, Qlocal_map, string); -- 2.39.2