From ae6ad50eda19608f882192d3957502b71845f9ea Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 29 Jul 2007 22:07:10 +0000 Subject: use correct length when making a copy of environ --- usr.bin/sudo/env.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/sudo/env.c b/usr.bin/sudo/env.c index 50adbae26fb..1652c8015d3 100644 --- a/usr.bin/sudo/env.c +++ b/usr.bin/sudo/env.c @@ -52,7 +52,7 @@ #include "sudo.h" #ifndef lint -__unused static const char rcsid[] = "$Sudo: env.c,v 1.39.2.15 2007/07/09 19:15:43 millert Exp $"; +__unused static const char rcsid[] = "$Sudo: env.c,v 1.39.2.16 2007/07/29 20:10:19 millert Exp $"; #endif /* lint */ /* @@ -629,7 +629,7 @@ insert_env_vars(envp, env_vars) env.env_size = evlen + 1 + 128; env.envp = emalloc2(env.env_size, sizeof(char *)); } - memcpy(env.envp, envp, evlen + 1); + memcpy(env.envp, envp, (evlen + 1) * sizeof(char *)); env.env_len = evlen; } -- cgit v1.2.3