1 From https://ftp.gnu.org/gnu/bash/bash-4.4-patches/bash44-006
3 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
11 Bug-Reported-by: <fernando@null-life.com>
12 Bug-Reference-ID: <CAEr-gPFPvqheiAeENmMkEwWRd4U=1iqCsYmR3sLdULOqL++_tQ@mail.gmail.com>
17 Out-of-range negative offsets to popd can cause the shell to crash attempting
18 to free an invalid memory block.
20 Patch (apply with `patch -p0'):
22 *** bash-4.4-patched/builtins/pushd.def 2016-01-25 13:31:49.000000000 -0500
23 --- b/builtins/pushd.def 2016-10-28 10:46:49.000000000 -0400
28 ! if (which > directory_list_offset || (directory_list_offset == 0 && which == 0))
30 pushd_error (directory_list_offset, which_word ? which_word : "");
34 ! if (which > directory_list_offset || (which < -directory_list_offset) || (directory_list_offset == 0 && which == 0))
36 pushd_error (directory_list_offset, which_word ? which_word : "");
40 of the list into place. */
41 i = (direction == '+') ? directory_list_offset - which : which;
42 + if (i < 0 || i > directory_list_offset)
44 + pushd_error (directory_list_offset, which_word ? which_word : "");
45 + return (EXECUTION_FAILURE);
47 free (pushd_directory_list[i]);
48 directory_list_offset--;
49 *** bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
50 --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
53 looks for to find the patch level (for the sccs version string). */
55 ! #define PATCHLEVEL 5
57 #endif /* _PATCHLEVEL_H_ */
59 looks for to find the patch level (for the sccs version string). */
61 ! #define PATCHLEVEL 6
63 #endif /* _PATCHLEVEL_H_ */