diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-11-26 20:44:27 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-11-26 20:44:27 -0500 |
commit | 1bf1ceeb04a2f57e1e5e1636a8c288c4d0db6682 (patch) | |
tree | 716e5fc0cf36ff5db696750ae58165e4b9618a09 /app-shells/bash/files/bash-4.4-popd-offset-overflow.patch | |
parent | 02c897444d280edc7330204b9fb43afb0a52d0ba (diff) | |
download | gentoo-1bf1ceeb04a2f57e1e5e1636a8c288c4d0db6682.tar.gz gentoo-1bf1ceeb04a2f57e1e5e1636a8c288c4d0db6682.tar.xz |
app-shells/bash: upstream fix for crash on invalid popd #600174
Diffstat (limited to 'app-shells/bash/files/bash-4.4-popd-offset-overflow.patch')
-rw-r--r-- | app-shells/bash/files/bash-4.4-popd-offset-overflow.patch | 30 |
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 00000000000..c6ef19d03f5 --- /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--; |