Avoid passing uninitialized stack to addelem() if called with an empty arg.

PR:		bin/171174
This commit is contained in:
Ed Maste 2012-08-29 21:38:34 +00:00
parent 9a6a13d687
commit 4285666880
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239883

View File

@ -889,8 +889,8 @@ add_list(struct listinfo *inf, const char *argp)
int toolong; int toolong;
char elemcopy[PATH_MAX]; char elemcopy[PATH_MAX];
if (*argp == 0) if (*argp == '\0')
inf->addelem(inf, elemcopy); inf->addelem(inf, argp);
while (*argp != '\0') { while (*argp != '\0') {
while (*argp != '\0' && strchr(W_SEP, *argp) != NULL) while (*argp != '\0' && strchr(W_SEP, *argp) != NULL)
argp++; argp++;