From 7ce802792ea29e075d543f54e60f8f785772a99c Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 12 Apr 2010 07:56:32 -0400 Subject: [PATCH] NULL-terminate env_add --- src/parse_args.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parse_args.c b/src/parse_args.c index 4d777ce94..1c55f77e9 100644 --- a/src/parse_args.c +++ b/src/parse_args.c @@ -128,7 +128,6 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp, int env_size = 32; env_add = emalloc2(env_size, sizeof(char *)); - env_add[0] = NULL; /* Pass progname to plugin so it can call setprogname() */ sudo_settings[ARG_PROGNAME].value = getprogname(); @@ -296,6 +295,7 @@ parse_args(int argc, char **argv, int *nargc, char ***nargv, char ***settingsp, break; } } + env_add[nenv] = NULL; argc -= optind; argv += optind;