121-upstream-bash43-021.patch (1446B)
1 BASH PATCH REPORT 2 ================= 3 4 Bash-Release: 4.3 5 Patch-ID: bash43-021 6 7 Bug-Reported-by: Jared Yanovich <slovichon@gmail.com> 8 Bug-Reference-ID: <20140625225019.GJ17044@nightderanger.psc.edu> 9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00070.html 10 11 Bug-Description: 12 13 When the readline `revert-all-at-newline' option is set, pressing newline 14 when the current line is one retrieved from history results in a double free 15 and a segmentation fault. 16 17 Patch (apply with `patch -p0'): 18 19 --- a/lib/readline/misc.c 20 +++ b/lib/readline/misc.c 21 @@ -461,6 +461,7 @@ _rl_revert_all_lines () 22 saved_undo_list = 0; 23 /* Set up rl_line_buffer and other variables from history entry */ 24 rl_replace_from_history (entry, 0); /* entry->line is now current */ 25 + entry->data = 0; /* entry->data is now current undo list */ 26 /* Undo all changes to this history entry */ 27 while (rl_undo_list) 28 rl_do_undo (); 29 @@ -468,7 +469,6 @@ _rl_revert_all_lines () 30 the timestamp. */ 31 FREE (entry->line); 32 entry->line = savestring (rl_line_buffer); 33 - entry->data = 0; 34 } 35 entry = previous_history (); 36 } 37 --- a/patchlevel.h 38 +++ b/patchlevel.h 39 @@ -25,6 +25,6 @@ 40 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh 41 looks for to find the patch level (for the sccs version string). */ 42 43 -#define PATCHLEVEL 20 44 +#define PATCHLEVEL 21 45 46 #endif /* _PATCHLEVEL_H_ */