diff options
Diffstat (limited to 'usr.bin/sudo/env.c')
-rw-r--r-- | usr.bin/sudo/env.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sudo/env.c b/usr.bin/sudo/env.c index 48aa221753a..0308d169981 100644 --- a/usr.bin/sudo/env.c +++ b/usr.bin/sudo/env.c @@ -250,8 +250,8 @@ insert_env(str, dupcheck) char **nep; size_t varlen; - /* Make sure there is room for the new entry. */ - if (env_len + 1 > env_size) { + /* Make sure there is room for the new entry plus a NULL. */ + if (env_len + 2 > env_size) { env_size += 128; new_environ = erealloc3(new_environ, env_size, sizeof(char *)); } |