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)
This commit is contained in:
Eli Zaretskii 2016-02-15 16:03:54 +02:00
parent 652e5b49d9
commit 44b16f60fd

View file

@ -1245,7 +1245,7 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform,
for (i = 0; i < clausenb; i++) for (i = 0; i < clausenb; i++)
{ {
Lisp_Object clause = clauses[i]; Lisp_Object clause = clauses[i];
Lisp_Object condition = XCAR (clause); Lisp_Object condition = CONSP (clause) ? XCAR (clause) : Qnil;
if (!CONSP (condition)) if (!CONSP (condition))
condition = Fcons (condition, Qnil); condition = Fcons (condition, Qnil);
struct handler *c = push_handler (condition, CONDITION_CASE); struct handler *c = push_handler (condition, CONDITION_CASE);