103-upstream-bash43-003.patch (1283B)
1 BASH PATCH REPORT 2 ================= 3 4 Bash-Release: 4.3 5 Patch-ID: bash43-003 6 7 Bug-Reported-by: Anatol Pomozov <anatol.pomozov@gmail.com> 8 Bug-Reference-ID: <CAOMFOmXy3mT2So5GQ5F-smCVArQuAeBwZ2QKzgCtMeXJoDeYOQ@mail.gmail.com> 9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00010.html 10 11 Bug-Description: 12 13 When in callback mode, some readline commands can cause readline to seg 14 fault by passing invalid contexts to callback functions. 15 16 Patch (apply with `patch -p0'): 17 18 --- a/lib/readline/readline.c 19 +++ b/lib/readline/readline.c 20 @@ -744,7 +744,8 @@ _rl_dispatch_callback (cxt) 21 r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ)); 22 23 RL_CHECK_SIGNALS (); 24 - if (r == 0) /* success! */ 25 + /* We only treat values < 0 specially to simulate recursion. */ 26 + if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */ 27 { 28 _rl_keyseq_chain_dispose (); 29 RL_UNSETSTATE (RL_STATE_MULTIKEY); 30 --- a/patchlevel.h 31 +++ b/patchlevel.h 32 @@ -25,6 +25,6 @@ 33 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh 34 looks for to find the patch level (for the sccs version string). */ 35 36 -#define PATCHLEVEL 2 37 +#define PATCHLEVEL 3 38 39 #endif /* _PATCHLEVEL_H_ */