]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
Bash-5.3 patch 7: fix issue where nofork command substitutions can affect redirection...
authorChet Ramey <chet.ramey@case.edu>
Wed, 26 Nov 2025 17:50:54 +0000 (12:50 -0500)
committerChet Ramey <chet.ramey@case.edu>
Wed, 26 Nov 2025 17:50:54 +0000 (12:50 -0500)
patchlevel.h
subst.c

index b8e99ec95f2f0d2bdf17bae11255661f99a620a3..816ef06b4d71e3a95db061fc3e79f37564f51bbf 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 6
+#define PATCHLEVEL 7
 
 #endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index a8ae174d5da3854fa1c0cf1f98390f76a638ac5e..dd5d57bf2fd2bd6df45d6fcb782208bcef51b07e 100644 (file)
--- a/subst.c
+++ b/subst.c
@@ -206,6 +206,8 @@ extern int wordexp_only;
 extern int singlequote_translations;
 extern int extended_quote;
 
+extern REDIRECT *exec_redirection_undo_list, *redirection_undo_list;
+
 #if !defined (HAVE_WCSDUP) && defined (HANDLE_MULTIBYTE)
 extern wchar_t *wcsdup (const wchar_t *);
 #endif
@@ -7000,6 +7002,11 @@ function_substitute (char *string, int quoted, int flags)
       add_unwind_protect (uw_restore_pipestatus_array, psa);
     }
 #endif
+
+  unwind_protect_pointer (redirection_undo_list);
+  redirection_undo_list = NULL;
+  unwind_protect_pointer (exec_redirection_undo_list);
+  exec_redirection_undo_list = NULL;
   
   subst_assign_varlist = 0;