From: Andreas Schwab <schwab@suse.de>
To: Philipp <p.stephani2@gmail.com>
Cc: 31186-done@debbugs.gnu.org
Subject: bug#31186: 27.0.50; Undefined behavior in lisp_file_lexically_bound_p
Date: Tue, 17 Apr 2018 11:48:04 +0200 [thread overview]
Message-ID: <mvmlgdmgo4r.fsf@suse.de> (raw)
In-Reply-To: <m2muy2fzhw.fsf@gmail.com> (Philipp's message of "Tue, 17 Apr 2018 02:27:55 +0200")
On Apr 17 2018, Philipp <p.stephani2@gmail.com> wrote:
> Loading a file or evaluating a buffer with the following contents causes
> undefined behavior, normally resulting in a segmentation fault:
>
> ;; -*- -:*-
>
> For example:
>
> $ emacs -Q -batch -nw -eval '(with-temp-buffer (insert ";; -*- -:*-") (eval-buffer))'
> Fatal error 11: Segmentation faultAbort trap: 6
I have installed this patch in the emacs-26 branch:
* src/lread.c (lisp_file_lexically_bound_p): Reset
beg_end_state before reading variable or value.
---
src/lread.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/lread.c b/src/lread.c
index 3104c441ec..72523c057f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -896,6 +896,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
ch = READCHAR;
i = 0;
+ beg_end_state = NOMINAL;
while (ch != ':' && ch != '\n' && ch != EOF && in_file_vars)
{
if (i < sizeof var - 1)
@@ -921,6 +922,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
ch = READCHAR;
i = 0;
+ beg_end_state = NOMINAL;
while (ch != ';' && ch != '\n' && ch != EOF && in_file_vars)
{
if (i < sizeof val - 1)
--
2.17.0
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
prev parent reply other threads:[~2018-04-17 9:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-17 0:27 bug#31186: 27.0.50; Undefined behavior in lisp_file_lexically_bound_p Philipp
2018-04-17 9:48 ` Andreas Schwab [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mvmlgdmgo4r.fsf@suse.de \
--to=schwab@suse.de \
--cc=31186-done@debbugs.gnu.org \
--cc=p.stephani2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.