From 1bf1ceeb04a2f57e1e5e1636a8c288c4d0db6682 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 26 Nov 2016 20:44:27 -0500 Subject: [PATCH] app-shells/bash: upstream fix for crash on invalid popd #600174 --- app-shells/bash/bash-4.4-r1.ebuild | 248 ------------------ ...sh-4.4_p5.ebuild => bash-4.4_p5-r1.ebuild} | 1 + .../files/bash-4.4-popd-offset-overflow.patch | 30 +++ 3 files changed, 31 insertions(+), 248 deletions(-) delete mode 100644 app-shells/bash/bash-4.4-r1.ebuild rename app-shells/bash/{bash-4.4_p5.ebuild => bash-4.4_p5-r1.ebuild} (99%) create mode 100644 app-shells/bash/files/bash-4.4-popd-offset-overflow.patch diff --git a/app-shells/bash/bash-4.4-r1.ebuild b/app-shells/bash/bash-4.4-r1.ebuild deleted file mode 100644 index 37e7af71547a..000000000000 --- a/app-shells/bash/bash-4.4-r1.ebuild +++ /dev/null @@ -1,248 +0,0 @@ -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI="5" - -inherit eutils flag-o-matic toolchain-funcs multilib prefix - -# Official patchlevel -# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/ -PLEVEL=${PV##*_p} -MY_PV=${PV/_p*} -MY_PV=${MY_PV/_/-} -MY_P=${PN}-${MY_PV} -[[ ${PV} != *_p* ]] && PLEVEL=0 -patches() { - local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}} - [[ ${plevel} -eq 0 ]] && return 1 - eval set -- {1..${plevel}} - set -- $(printf "${pn}${pv/\.}-%03d " "$@") - if [[ ${opt} == -s ]] ; then - echo "${@/#/${DISTDIR}/}" - else - local u - for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do - printf "${u}/${pn}-${pv}-patches/%s " "$@" - done - fi -} - -# The version of readline this bash normally ships with. -READLINE_VER="7.0" - -DESCRIPTION="The standard GNU Bourne again shell" -HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html" -case ${PV} in -*_alpha*|*_beta*|*_rc*) SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz" ;; -*) SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)" ;; -esac - -LICENSE="GPL-3" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd" -IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline" - -DEPEND=">=sys-libs/ncurses-5.2-r2:0= - readline? ( >=sys-libs/readline-${READLINE_VER}:0= ) - nls? ( virtual/libintl )" -RDEPEND="${DEPEND} - ! 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--; -- 2.26.2