From 1f6247c83d7336242fcabd45f994e0c13e8acecd Mon Sep 17 00:00:00 2001 From: hubertf Date: Fri, 24 Sep 1999 14:39:44 +0000 Subject: [PATCH] Add some sanity checks on what pkgdb_retrieve() returns. Noted by D'Arcy J.M. Cain on current-users. --- usr.sbin/pkg_install/delete/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg_install/delete/main.c b/usr.sbin/pkg_install/delete/main.c index 443ec0a38071..762b61030348 100644 --- a/usr.sbin/pkg_install/delete/main.c +++ b/usr.sbin/pkg_install/delete/main.c @@ -1,11 +1,11 @@ -/* $NetBSD: main.c,v 1.13 1999/08/24 00:48:39 hubertf Exp $ */ +/* $NetBSD: main.c,v 1.14 1999/09/24 14:39:44 hubertf Exp $ */ #include #ifndef lint #if 0 static char *rcsid = "from FreeBSD Id: main.c,v 1.11 1997/10/08 07:46:48 charnier Exp"; #else -__RCSID("$NetBSD: main.c,v 1.13 1999/08/24 00:48:39 hubertf Exp $"); +__RCSID("$NetBSD: main.c,v 1.14 1999/09/24 14:39:44 hubertf Exp $"); #endif #endif @@ -181,6 +181,8 @@ main(int argc, char **argv) error = 0; while ((key = pkgdb_iter())) { val = pkgdb_retrieve(key); + if (val == NULL || *val == '\0') + continue; lpp = TAILQ_FIRST(&pkgs); if (lpp != NULL) {