← Commit list

1c5455284

Denys Vlasenko
Denys Vlasenko
2022-08-02
SUCCESS Duration: 153s

Subject

ash: fix ifs cleanup on error paths

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/ash.c+2 -0
@@ -7028,6 +7028,7 @@ varunset(const char *end, const char *var, const char *umsg, int varflags)
msg = umsg;
}
}
+ ifsfree();
ash_msg_and_raise_error("%.*s: %s%s", (int)(end - var - 1), var, msg, tail);
}
@@ -7453,6 +7454,7 @@ varvalue(char *name, int varflags, int flags, int quoted)
if (discard)
return -1;
+ ifsfree();
raise_error_syntax("bad substitution");
}
shell/ash_test/ash-heredoc/heredoc_and_cmd.right+2 -0
@@ -0,0 +1,2 @@
+./heredoc_and_cmd.tests: line 4: D: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+Y
shell/ash_test/ash-heredoc/heredoc_and_cmd.tests+8 -0
@@ -0,0 +1,8 @@
+# The bug was only happening with <<REDIR;CMD form below:
+M='AAAAAAAAAAAAAAAAA'
+fff(){
+date <<000; echo Y
+${D?$M$M$M$M$M$M}
+000
+}
+fff
shell/hush_test/hush-heredoc/heredoc_and_cmd.right+2 -0
@@ -0,0 +1,2 @@
+hush: D: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+Y
shell/hush_test/hush-heredoc/heredoc_and_cmd.tests+8 -0
@@ -0,0 +1,8 @@
+# The bug was only happening with <<REDIR;CMD form below:
+M='AAAAAAAAAAAAAAAAA'
+fff(){
+date <<000; echo Y
+${D?$M$M$M$M$M$M}
+000
+}
+fff