Skip to content

Commit 24cc3f4

Browse files
committed
Fix a crash in intercept mode running a command with NULL argv[0].
Newer Linux kernels replace a NULL argv[0] with the empty string, we should as well. --HG-- branch : 1.9
1 parent 8f3b92e commit 24cc3f4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/exec_ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1795,7 +1795,7 @@ ptrace_intercept_execve(pid_t pid, struct intercept_closure *closure)
17951795
}
17961796

17971797
/* We can only pass the pathname to exececute via argv[0] (plugin API). */
1798-
orig_argv0 = argv[0];
1798+
orig_argv0 = argv[0] ? argv[0] : (char *)"";
17991799
argv[0] = pathname;
18001800
if (argc == 0) {
18011801
/* Rewrite an empty argv[] with the path to execute. */

0 commit comments

Comments
 (0)