← Commit list

28736c36c

Mike Frysinger
Mike Frysinger
2009-10-18
FAILED Duration: 33s

Subject

hush: handle empty execs

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/hush.c+6 -0
@@ -3895,6 +3895,12 @@ static NOINLINE int run_pipe(struct pipe *pi)
argv_expanded = expand_strvec_to_strvec(argv + command->assignment_cnt);
}
+ /* if someone gives us an empty string: ``, $(), ... */
+ if (!argv_expanded[0]) {
+ debug_leave();
+ return 0;
+ }
+
x = find_builtin(argv_expanded[0]);
#if ENABLE_HUSH_FUNCTIONS
funcp = NULL;
shell/hush_test/hush-psubst/emptytick.right+14 -0
@@ -0,0 +1,14 @@
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
shell/hush_test/hush-psubst/emptytick.tests+16 -0
@@ -0,0 +1,16 @@
+true; ``; echo $?
+false; ``; echo $?
+true; `""`; echo $?
+false; `""`; echo $?
+true; ` `; echo $?
+false; ` `; echo $?
+
+true; $(); echo $?
+false; $(); echo $?
+true; $(""); echo $?
+false; $(""); echo $?
+true; $( ); echo $?
+false; $( ); echo $?
+
+true; exec ''; echo $?
+false; exec ''; echo $?