From ceb46f002145e986c944b2423404535019b7e62b Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Wed, 12 Oct 2016 22:48:32 +0200 Subject: [PATCH] Fix crash in evaluating functions See Bug#24673 * src/eval.c (funcall_lambda): Fix crash for bogus functions such as (closure). --- src/eval.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eval.c b/src/eval.c index 13a41a2ae20..b94712d4579 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2825,9 +2825,11 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, { if (EQ (XCAR (fun), Qclosure)) { - fun = XCDR (fun); /* Drop `closure'. */ + Lisp_Object cdr = XCDR (fun); /* Drop `closure'. */ + if (! CONSP (cdr)) + xsignal1 (Qinvalid_function, fun); + fun = cdr; lexenv = XCAR (fun); - CHECK_LIST_CONS (fun, fun); } else lexenv = Qnil; -- 2.39.2