From 63e59c8ca51ced6c4d5951281cb21288da32ced3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 28 Aug 2018 10:20:46 +0300 Subject: [PATCH] Avoid crashes in malformed defvar * src/eval.c (Fdefvar): Don't call XSYMBOL on something that might not be a symbol. This avoids crashes due to malformed 'defvar' forms. (Bug#32552) --- src/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eval.c b/src/eval.c index 40cba3bb1ce..f9563a3f80c 100644 --- a/src/eval.c +++ b/src/eval.c @@ -773,7 +773,7 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) LOADHIST_ATTACH (sym); } else if (!NILP (Vinternal_interpreter_environment) - && !XSYMBOL (sym)->u.s.declared_special) + && (SYMBOLP (sym) && !XSYMBOL (sym)->u.s.declared_special)) /* A simple (defvar foo) with lexical scoping does "nothing" except declare that var to be dynamically scoped *locally* (i.e. within the current file or let-block). */ -- 2.39.2