summaryrefslogtreecommitdiff
path: root/src/keymap.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2006-10-13 01:45:37 +0000
committerChong Yidong <cyd@stupidchicken.com>2006-10-13 01:45:37 +0000
commiteae637ecd36a501b16886434f1a40ac6b3b384c1 (patch)
treed887405806c9ceaff7b854eb6262ed914e76796e /src/keymap.c
parentd81608e0842c2d1646e9b5407c2a308b624da251 (diff)
downloademacs-eae637ecd36a501b16886434f1a40ac6b3b384c1.tar.gz
* keymap.c (Fkey_binding): Check Lisp_Object types before doing
XCAR and XINT.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c16
1 files changed, 8 insertions, 8 deletions
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);