From: Chet Ramey Date: Wed, 5 Oct 2022 14:36:55 +0000 (-0400) Subject: Bash-5.2 patch 1: fix crash with unset arrays in arithmetic contexts X-Git-Tag: bash-5.3-alpha~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a1e58b8c064cbf3cb0180b63e581770de7ccea5b;p=thirdparty%2Fbash.git Bash-5.2 patch 1: fix crash with unset arrays in arithmetic contexts --- diff --git a/patchlevel.h b/patchlevel.h index 165390c15..c0dbb500d 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -25,6 +25,6 @@ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh looks for to find the patch level (for the sccs version string). */ -#define PATCHLEVEL 0 +#define PATCHLEVEL 1 #endif /* _PATCHLEVEL_H_ */ diff --git a/subst.c b/subst.c index d9feabca9..93b91606c 100644 --- a/subst.c +++ b/subst.c @@ -10857,7 +10857,7 @@ expand_array_subscript (string, sindex, quoted, flags) exp = substring (string, si+1, ni); t = expand_subscript_string (exp, quoted & ~(Q_ARITH|Q_DOUBLE_QUOTES)); free (exp); - exp = sh_backslash_quote (t, abstab, 0); + exp = t ? sh_backslash_quote (t, abstab, 0) : savestring (""); free (t); slen = STRLEN (exp);