aboutsummaryrefslogtreecommitdiffstats
path: root/test/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 /test/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 'test/src')
-rw-r--r--test/src/keymap-tests.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el
index b835fc7530b..26d34858703 100644
--- a/test/src/keymap-tests.el
+++ b/test/src/keymap-tests.el
@@ -38,6 +38,13 @@ commit 86c19714b097aa477d339ed99ffb5136c755a046."
38 (should (eq (lookup-key Buffer-menu-mode-map [32]) 'undefined))) 38 (should (eq (lookup-key Buffer-menu-mode-map [32]) 'undefined)))
39 (define-key Buffer-menu-mode-map [32] def)))) 39 (define-key Buffer-menu-mode-map [32] def))))
40 40
41(ert-deftest keymap-where-is-internal-test ()
42 "Make sure we don't crash when `where-is-preferred-modifier' is not a symbol."
43 (should
44 (equal (let ((where-is-preferred-modifier "alt"))
45 (where-is-internal 'execute-extended-command global-map t))
46 [#x8000078])))
47
41(provide 'keymap-tests) 48(provide 'keymap-tests)
42 49
43;;; keymap-tests.el ends here 50;;; keymap-tests.el ends here