summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-02-15 16:03:54 +0200
committerEli Zaretskii <eliz@gnu.org>2016-02-15 16:03:54 +0200
commit44b16f60fd80afe574964390d896635971cb5504 (patch)
tree758f8f82608148b93e329bc1c2cdf4a65b3a75ef /src/eval.c
parent652e5b49d92d77fe057cf73bcb41f7170182bc8d (diff)
downloademacs-44b16f60fd80afe574964390d896635971cb5504.tar.gz
Avoid crashes in semi-malformed 'condition-case'
* src/eval.c (internal_lisp_condition_case): Treat a handler '(nil)' as if it were '(nil nil)'. (Bug#22675)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 6c912bc4762..26104a58277 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1245,7 +1245,7 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform,
for (i = 0; i < clausenb; i++)
{
Lisp_Object clause = clauses[i];
- Lisp_Object condition = XCAR (clause);
+ Lisp_Object condition = CONSP (clause) ? XCAR (clause) : Qnil;
if (!CONSP (condition))
condition = Fcons (condition, Qnil);
struct handler *c = push_handler (condition, CONDITION_CASE);