Provide protection against incorrect input (dependency list).

Submitted by:	roam
This commit is contained in:
Maxim Sobolev 2002-02-20 17:07:19 +00:00
parent 2335a944a8
commit f62b5ea330

View File

@ -126,11 +126,14 @@ pkg_perform(char **pkgs)
errx(2, "%s: alloca() failed", __FUNCTION__);
/* Not reached */
}
for (i = 0; Pkgdeps; i++) {
for (i = 0; Pkgdeps;) {
cp = strsep(&Pkgdeps, " \t\n");
if (*cp)
if (*cp) {
deps[i] = cp;
i++;
}
}
ndeps = i;
deps[ndeps] = NULL;
sortdeps(deps);