diff options
author | joerg <joerg> | 2007-08-15 01:21:46 +0000 |
---|---|---|
committer | joerg <joerg> | 2007-08-15 01:21:46 +0000 |
commit | 89086d41bfac8a3b6569bdc233b373524bf27f21 (patch) | |
tree | 3a352d00fec4a96751d2cb667e9eea2694d3e1f2 /pkgtools | |
parent | 1c277c87cd22ea760e2a5f7e2c95c13fde8accbb (diff) | |
download | pkgsrc-89086d41bfac8a3b6569bdc233b373524bf27f21.tar.gz |
Bail out if the PLIST contains no @name field. This check existed since
the initial revision in 2002, so assume it just works...
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_install/files/add/perform.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c index f1e2f94d975..87a001f2f93 100644 --- a/pkgtools/pkg_install/files/add/perform.c +++ b/pkgtools/pkg_install/files/add/perform.c @@ -1,4 +1,4 @@ -/* $NetBSD: perform.c,v 1.58 2007/08/15 01:16:27 joerg Exp $ */ +/* $NetBSD: perform.c,v 1.59 2007/08/15 01:21:46 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -14,7 +14,7 @@ #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.58 2007/08/15 01:16:27 joerg Exp $"); +__RCSID("$NetBSD: perform.c,v 1.59 2007/08/15 01:21:46 joerg Exp $"); #endif #endif @@ -589,7 +589,12 @@ pkg_do(const char *pkg, lpkg_head_t *pkgs) } /* Protect against old packages with bogus @name fields */ - PkgName = (p = find_plist(&Plist, PLIST_NAME)) ? p->name : "anonymous"; + p = find_plist(&Plist, PLIST_NAME); + if (p->name == NULL) { + warnx("PLIST contains no @name field"); + goto bomb; + } + PkgName = p->name; if (fexists(VIEWS_FNAME)) is_depoted_pkg = TRUE; |