Fix segfault while running with -a option and deinstalling broken

packages with incorrect plists.

PR:		bin/115327
Submitted by:	Michael Zhilin <mizhka@gmail.com>
MFC after:	3 days
This commit is contained in:
krion 2007-11-10 22:57:12 +00:00
parent 38ba9268aa
commit 10e9042adf

View File

@ -266,7 +266,7 @@ pkg_do(char *pkg)
for (p = Plist.head; p ; p = p->next) {
if (p->type != PLIST_PKGDEP)
continue;
deporigin = (p->next->type == PLIST_DEPORIGIN) ? p->next->name :
deporigin = (p->next != NULL && p->next->type == PLIST_DEPORIGIN) ? p->next->name :
NULL;
if (Verbose) {
printf("Trying to remove dependency on package '%s'", p->name);