Merge pull request #2461 from rbenv/openssl-version-check

Avoid array subscript error when checking OpenSSL versions
This commit is contained in:
Mislav Marohnić 2024-11-05 23:42:34 +01:00 committed by GitHub
commit 1ab17dad3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1154,7 +1154,7 @@ needs_openssl() {
# shellcheck disable=SC2207
versions=( $(awk '{print $2}' <<<"$brew_installs" | sort_versions) )
local index="${#versions[@]}"
while [ $((index--)) -ge 0 ]; do
while [ $((--index)) -ge 0 ]; do
homebrew_version="$(normalize_semver "${versions[index]}")"
(( homebrew_version >= lower_bound && homebrew_version < upper_bound )) || continue
while read -r formula version prefix; do