103-upstream-bash43-003.patch 1.3 KB

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