aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2014-09-25 23:31:51 -0600
committerJoey Hewitt <joey@joeyhewitt.com>2014-09-25 23:31:51 -0600
commit58b59146c7cfd39b08f13fe829c7a269c61fe7f4 (patch)
tree1459649887ac63ae06b38b942a6f78076c4585a4
parent1392e41109f3dbae276726ae0af1f15c87829df5 (diff)
downloadandroid_external_bash-58b59146c7cfd39b08f13fe829c7a269c61fe7f4.tar.gz
android_external_bash-58b59146c7cfd39b08f13fe829c7a269c61fe7f4.tar.bz2
android_external_bash-58b59146c7cfd39b08f13fe829c7a269c61fe7f4.zip
Patch-ID: bash41-013 Under certain circumstances, bash can incorrectly save a lookahead character and return it on a subsequent call, even when reading a new line. Change-Id: I29dcf444011f77e104b6a82e8cada731e3917646 ref: http://seclists.org/oss-sec/2014/q3/734 ref: http://seclists.org/oss-sec/2014/q3/685
-rw-r--r--parse.y2
-rw-r--r--y.tab.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index e265a89..38fb260 100644
--- a/parse.y
+++ b/parse.y
@@ -2848,6 +2848,8 @@ reset_parser ()
FREE (word_desc_to_read);
word_desc_to_read = (WORD_DESC *)NULL;
+ eol_ungetc_lookahead = 0;
+
current_token = '\n'; /* XXX */
last_read_token = '\n';
token_to_read = '\n';
diff --git a/y.tab.c b/y.tab.c
index 85c96d7..ff11a5d 100644
--- a/y.tab.c
+++ b/y.tab.c
@@ -5160,6 +5160,8 @@ reset_parser ()
FREE (word_desc_to_read);
word_desc_to_read = (WORD_DESC *)NULL;
+ eol_ungetc_lookahead = 0;
+
current_token = '\n'; /* XXX */
last_read_token = '\n';
token_to_read = '\n';