aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Schwab2018-04-17 11:36:36 +0200
committerAndreas Schwab2018-04-17 11:43:14 +0200
commit3fa472b4873b395e6f9400884ee22b66c0a86966 (patch)
tree2e753d77b14bdbc35f14b3beaa3b3a53d6321de7 /src
parent4341aacd87912e7ba2c781fef9f1ff73d1a5bf0a (diff)
downloademacs-3fa472b4873b395e6f9400884ee22b66c0a86966.tar.gz
emacs-3fa472b4873b395e6f9400884ee22b66c0a86966.zip
Fix undefined behaviour while looking for lexical-binding file variable (bug 31186)
* src/lread.c (lisp_file_lexically_bound_p): Reset beg_end_state before reading variable or value.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lread.c b/src/lread.c
index 3104c441ecf..72523c057f1 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -896,6 +896,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
896 ch = READCHAR; 896 ch = READCHAR;
897 897
898 i = 0; 898 i = 0;
899 beg_end_state = NOMINAL;
899 while (ch != ':' && ch != '\n' && ch != EOF && in_file_vars) 900 while (ch != ':' && ch != '\n' && ch != EOF && in_file_vars)
900 { 901 {
901 if (i < sizeof var - 1) 902 if (i < sizeof var - 1)
@@ -921,6 +922,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
921 ch = READCHAR; 922 ch = READCHAR;
922 923
923 i = 0; 924 i = 0;
925 beg_end_state = NOMINAL;
924 while (ch != ';' && ch != '\n' && ch != EOF && in_file_vars) 926 while (ch != ';' && ch != '\n' && ch != EOF && in_file_vars)
925 { 927 {
926 if (i < sizeof val - 1) 928 if (i < sizeof val - 1)