From: Michal Sojka Date: Tue, 12 Sep 2017 11:12:33 +0000 (+0200) Subject: utrace: Fix environment initialization X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5acaf15b4e06e971e5a80d49f47d7eec54abe8df;p=oweals%2Fprocd.git utrace: Fix environment initialization We want to copy the existing environment instead of the new one to itself. Other bugs in this code are fixed in the next commit. Signed-off-by: Michal Sojka --- diff --git a/trace/trace.c b/trace/trace.c index fdffaba..04bf7a5 100644 --- a/trace/trace.c +++ b/trace/trace.c @@ -186,7 +186,7 @@ int main(int argc, char **argv, char **envp) ; _envp = calloc(envc, sizeof(char *)); - memcpy(&_envp[1], _envp, envc * sizeof(char *)); + memcpy(&_envp[1], envp, envc * sizeof(char *)); *_envp = preload; ret = execve(_argv[0], _argv, _envp);