2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-29 13:28:10 +00:00

NULL-terminate env_add

This commit is contained in:
Todd C. Miller 2010-04-12 07:56:32 -04:00
parent 0494774f30
commit 7ce802792e

View File

@ -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;