Commit 296dadb1 authored by Eli Zaretskii's avatar Eli Zaretskii

Avoid crashes when key-binding is called from a timer

* src/keymap.c (Fkey_binding): Don't segfault if called with an
empty vector as KEY.  (Bug#20705)
parent a04d35cb
...@@ -1652,10 +1652,14 @@ specified buffer position instead of point are used. ...@@ -1652,10 +1652,14 @@ specified buffer position instead of point are used.
if (NILP (position) && VECTORP (key)) if (NILP (position) && VECTORP (key))
{ {
Lisp_Object event Lisp_Object event;
/* mouse events may have a symbolic prefix indicating the
scrollbar or mode line */ if (ASIZE (key) == 0)
= AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0); return Qnil;
/* mouse events may have a symbolic prefix indicating the
scrollbar or mode line */
event = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0);
/* We are not interested in locations without event data */ /* We are not interested in locations without event data */
......
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