Provide protection against incorrect input (dependency list).
Submitted by: roam
This commit is contained in:
parent
2335a944a8
commit
f62b5ea330
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user