From: Eli Zaretskii Date: Tue, 28 Aug 2018 07:20:46 +0000 (+0300) Subject: Avoid crashes in malformed defvar X-Git-Tag: emacs-26.1.90~186 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=63e59c8ca51ced6c4d5951281cb21288da32ced3;p=emacs.git 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) --- 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). */