]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid crashes in malformed defvar
authorEli Zaretskii <eliz@gnu.org>
Tue, 28 Aug 2018 07:20:46 +0000 (10:20 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 28 Aug 2018 07:20:46 +0000 (10:20 +0300)
* 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

index 40cba3bb1ceaa627067acbdc5c23e79ae16d0ea5..f9563a3f80c1fc9615919f4f48dbf55777c0efa1 100644 (file)
@@ -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).  */