summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-11-26 20:44:27 -0500
committerMike Frysinger <vapier@gentoo.org>2016-11-26 20:44:27 -0500
commit1bf1ceeb04a2f57e1e5e1636a8c288c4d0db6682 (patch)
tree716e5fc0cf36ff5db696750ae58165e4b9618a09 /app-shells/bash/files
parentdev-libs/gmp: fix USE=pgo builds for some systems #568320 (diff)
downloadgentoo-1bf1ceeb04a2f57e1e5e1636a8c288c4d0db6682.tar.gz
gentoo-1bf1ceeb04a2f57e1e5e1636a8c288c4d0db6682.tar.bz2
gentoo-1bf1ceeb04a2f57e1e5e1636a8c288c4d0db6682.zip
app-shells/bash: upstream fix for crash on invalid popd #600174
Diffstat (limited to 'app-shells/bash/files')
-rw-r--r--app-shells/bash/files/bash-4.4-popd-offset-overflow.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/app-shells/bash/files/bash-4.4-popd-offset-overflow.patch b/app-shells/bash/files/bash-4.4-popd-offset-overflow.patch
new file mode 100644
index 000000000000..c6ef19d03f5a
--- /dev/null
+++ b/app-shells/bash/files/bash-4.4-popd-offset-overflow.patch
@@ -0,0 +1,30 @@
+https://bugs.gentoo.org/600174
+https://lists.gnu.org/archive/html/bug-bash/2016-11/msg00099.html
+
+*** ../bash-4.4-patched/builtins/pushd.def 2016-01-25 13:31:49.000000000 -0500
+--- builtins/pushd.def 2016-10-28 10:46:49.000000000 -0400
+***************
+*** 366,370 ****
+ }
+
+! if (which > directory_list_offset || (directory_list_offset == 0 && which == 0))
+ {
+ pushd_error (directory_list_offset, which_word ? which_word : "");
+--- 366,370 ----
+ }
+
+! if (which > directory_list_offset || (which < -directory_list_offset) || (directory_list_offset == 0 && which == 0))
+ {
+ pushd_error (directory_list_offset, which_word ? which_word : "");
+***************
+*** 388,391 ****
+--- 388,396 ----
+ of the list into place. */
+ i = (direction == '+') ? directory_list_offset - which : which;
++ if (i < 0 || i > directory_list_offset)
++ {
++ pushd_error (directory_list_offset, which_word ? which_word : "");
++ return (EXECUTION_FAILURE);
++ }
+ free (pushd_directory_list[i]);
+ directory_list_offset--;