2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

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
This commit is contained in:
Todd C. Miller
2023-07-12 09:29:00 -06:00
parent 8f3b92ee89
commit 24cc3f4c91

View File

@@ -1795,7 +1795,7 @@ ptrace_intercept_execve(pid_t pid, struct intercept_closure *closure)
}
/* We can only pass the pathname to exececute via argv[0] (plugin API). */
orig_argv0 = argv[0];
orig_argv0 = argv[0] ? argv[0] : (char *)"";
argv[0] = pathname;
if (argc == 0) {
/* Rewrite an empty argv[] with the path to execute. */