]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
Bash-5.2 patch 1: fix crash with unset arrays in arithmetic contexts
authorChet Ramey <chet.ramey@case.edu>
Wed, 5 Oct 2022 14:36:55 +0000 (10:36 -0400)
committerChet Ramey <chet.ramey@case.edu>
Wed, 5 Oct 2022 14:36:55 +0000 (10:36 -0400)
patchlevel.h
subst.c

index 165390c155411545a5e05f0ed98d1c85d0098955..c0dbb500db97e7042515f518c3011848d8cbfa76 100644 (file)
@@ -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 d9feabca9ec3bc0c91ea79c70a0608c391e095e8..93b91606c6b1891f012d3ebef6a59d6d728083d1 100644 (file)
--- 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);