diff options
author | Felix Fietkau <nbd@nbd.name> | 2016-12-05 18:16:47 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-12-05 18:19:10 +0100 |
commit | 794669c9ea00f4fc14a14899bcd2c9ea518c1a69 (patch) | |
tree | 023439934d80f921915a8d79344729a57a8b8e3d /trace | |
parent | 4004b68fe57dd72197b8a00b0756cc7f978ad88a (diff) | |
download | procd-794669c9ea00f4fc14a14899bcd2c9ea518c1a69.tar.gz |
trace: use the cloned environment pointer
Fixes an issue where it would overwrite the first environment variable
with the preload one
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'trace')
-rw-r--r-- | trace/trace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/trace/trace.c b/trace/trace.c index 662010e..fdffaba 100644 --- a/trace/trace.c +++ b/trace/trace.c @@ -187,9 +187,9 @@ int main(int argc, char **argv, char **envp) _envp = calloc(envc, sizeof(char *)); memcpy(&_envp[1], _envp, envc * sizeof(char *)); - *envp = preload; + *_envp = preload; - ret = execve(_argv[0], _argv, envp); + ret = execve(_argv[0], _argv, _envp); ERROR("failed to exec %s: %s\n", _argv[0], strerror(errno)); free(_argv); |