mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-03 07:45:47 +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:
@@ -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). */
|
/* 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;
|
argv[0] = pathname;
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
/* Rewrite an empty argv[] with the path to execute. */
|
/* Rewrite an empty argv[] with the path to execute. */
|
||||||
|
Reference in New Issue
Block a user