aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2016-08-29 17:27:06 +0300
committerEli Zaretskii2016-08-29 17:27:06 +0300
commit472ebd86277d26e6a7194e0e66fc171439fd8f44 (patch)
treeb6c2a582887ec766d8fadffe99c0f38db812f7b8 /src
parent67a01490934ba5a43b68b7141b20bc8e636ed7c5 (diff)
downloademacs-472ebd86277d26e6a7194e0e66fc171439fd8f44.tar.gz
emacs-472ebd86277d26e6a7194e0e66fc171439fd8f44.zip
Avoid crashes for invalid value of key modifiers
* src/keyboard.c (parse_solitary_modifier): If the argument SYMBOL is not a symbol, don't try to recognize it. See http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00502.html for the details. * test/src/keymap-tests.el (keymap-where-is-internal-test): New test, for testing the above fix.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index f27ca0f86e0..e44155260f8 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -6621,7 +6621,12 @@ has the same base event type and all the specified modifiers. */)
6621int 6621int
6622parse_solitary_modifier (Lisp_Object symbol) 6622parse_solitary_modifier (Lisp_Object symbol)
6623{ 6623{
6624 Lisp_Object name = SYMBOL_NAME (symbol); 6624 Lisp_Object name;
6625
6626 if (!SYMBOLP (symbol))
6627 return 0;
6628
6629 name = SYMBOL_NAME (symbol);
6625 6630
6626 switch (SREF (name, 0)) 6631 switch (SREF (name, 0))
6627 { 6632 {