From a2085809fab3b0eb29f07f1763f0bedfcb6b60c4 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 13 May 2016 06:40:59 -0600 Subject: [PATCH] Fix last commit, now that argc is not reset we need to explicitly start the copy from argv[1]. From Daniel Kopecek --- src/selinux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/selinux.c b/src/selinux.c index 522610e32..f0b9fbc02 100644 --- a/src/selinux.c +++ b/src/selinux.c @@ -425,7 +425,7 @@ selinux_execve(int fd, const char *path, char *const argv[], char *envp[], debug_return; } nargv[nargc++] = (char *)path; - memcpy(&nargv[nargc], &argv[argc], argc * sizeof(char *)); /* copies NULL */ + memcpy(&nargv[nargc], &argv[1], argc * sizeof(char *)); /* copies NULL */ /* sesh will handle noexec for us. */ sudo_execve(-1, sesh, nargv, envp, false); -- 2.40.0