From ec313b205f35f06c01321b26c2da883a9746afea Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Tue, 10 Jun 2025 12:00:30 +0000 Subject: [PATCH] Fix crash when evaluating "(signal nil 5)" (bug#78738) The docstring already warns against calling signal with a nil error symbol, which is for internal use only, but we can avoid crashing in this case. * src/eval.c (Fsignal): Produce a "peculiar error" for more arguments involving non-lists. (cherry picked from commit 888f846d377a589c6fca5be5d2f4274f423e5fcf) --- src/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eval.c b/src/eval.c index f447b5e9551..0ad26c43867 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1888,7 +1888,7 @@ See also the function `condition-case'. */ (Lisp_Object error_symbol, Lisp_Object data) { /* If they call us with nonsensical arguments, produce "peculiar error". */ - if (NILP (error_symbol) && NILP (data)) + if (NILP (error_symbol) && !CONSP (data)) error_symbol = Qerror; signal_or_quit (error_symbol, data, false); eassume (false); -- 2.39.5