126-upstream-bash43-026.patch (1319B)
1 BASH PATCH REPORT 2 ================= 3 4 Bash-Release: 4.3 5 Patch-ID: bash43-026 6 7 Bug-Reported-by: Tavis Ormandy <taviso@cmpxchg8b.com> 8 Bug-Reference-ID: 9 Bug-Reference-URL: http://twitter.com/taviso/statuses/514887394294652929 10 11 Bug-Description: 12 13 Under certain circumstances, bash can incorrectly save a lookahead character and 14 return it on a subsequent call, even when reading a new line. 15 16 Patch (apply with `patch -p0'): 17 18 --- a/parse.y 19 +++ b/parse.y 20 @@ -2953,6 +2953,8 @@ reset_parser () 21 FREE (word_desc_to_read); 22 word_desc_to_read = (WORD_DESC *)NULL; 23 24 + eol_ungetc_lookahead = 0; 25 + 26 current_token = '\n'; /* XXX */ 27 last_read_token = '\n'; 28 token_to_read = '\n'; 29 --- a/y.tab.c 30 +++ b/y.tab.c 31 @@ -5265,6 +5265,8 @@ reset_parser () 32 FREE (word_desc_to_read); 33 word_desc_to_read = (WORD_DESC *)NULL; 34 35 + eol_ungetc_lookahead = 0; 36 + 37 current_token = '\n'; /* XXX */ 38 last_read_token = '\n'; 39 token_to_read = '\n'; 40 @@ -8539,4 +8541,3 @@ set_line_mbstate () 41 } 42 } 43 #endif /* HANDLE_MULTIBYTE */ 44 - 45 --- a/patchlevel.h 46 +++ b/patchlevel.h 47 @@ -25,6 +25,6 @@ 48 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh 49 looks for to find the patch level (for the sccs version string). */ 50 51 -#define PATCHLEVEL 25 52 +#define PATCHLEVEL 26 53 54 #endif /* _PATCHLEVEL_H_ */