bash44-006.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From https://ftp.gnu.org/gnu/bash/bash-4.4-patches/bash44-006
  2. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  3. BASH PATCH REPORT
  4. =================
  5. Bash-Release: 4.4
  6. Patch-ID: bash44-006
  7. Bug-Reported-by: <fernando@null-life.com>
  8. Bug-Reference-ID: <CAEr-gPFPvqheiAeENmMkEwWRd4U=1iqCsYmR3sLdULOqL++_tQ@mail.gmail.com>
  9. Bug-Reference-URL:
  10. Bug-Description:
  11. Out-of-range negative offsets to popd can cause the shell to crash attempting
  12. to free an invalid memory block.
  13. Patch (apply with `patch -p0'):
  14. *** bash-4.4-patched/builtins/pushd.def 2016-01-25 13:31:49.000000000 -0500
  15. --- b/builtins/pushd.def 2016-10-28 10:46:49.000000000 -0400
  16. ***************
  17. *** 366,370 ****
  18. }
  19. ! if (which > directory_list_offset || (directory_list_offset == 0 && which == 0))
  20. {
  21. pushd_error (directory_list_offset, which_word ? which_word : "");
  22. --- b/366,370 ----
  23. }
  24. ! if (which > directory_list_offset || (which < -directory_list_offset) || (directory_list_offset == 0 && which == 0))
  25. {
  26. pushd_error (directory_list_offset, which_word ? which_word : "");
  27. ***************
  28. *** 388,391 ****
  29. --- b/388,396 ----
  30. of the list into place. */
  31. i = (direction == '+') ? directory_list_offset - which : which;
  32. + if (i < 0 || i > directory_list_offset)
  33. + {
  34. + pushd_error (directory_list_offset, which_word ? which_word : "");
  35. + return (EXECUTION_FAILURE);
  36. + }
  37. free (pushd_directory_list[i]);
  38. directory_list_offset--;
  39. *** bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
  40. --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
  41. ***************
  42. *** 26,30 ****
  43. looks for to find the patch level (for the sccs version string). */
  44. ! #define PATCHLEVEL 5
  45. #endif /* _PATCHLEVEL_H_ */
  46. --- b/26,30 ----
  47. looks for to find the patch level (for the sccs version string). */
  48. ! #define PATCHLEVEL 6
  49. #endif /* _PATCHLEVEL_H_ */