pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files/add Bail out if the PLIST c...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/95494e947545
branches:  trunk
changeset: 532249:95494e947545
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Aug 15 01:21:46 2007 +0000

description:
Bail out if the PLIST contains no @name field. This check existed since
the initial revision in 2002, so assume it just works...

diffstat:

 pkgtools/pkg_install/files/add/perform.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r eea8bf3e1a90 -r 95494e947545 pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c  Wed Aug 15 01:16:27 2007 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c  Wed Aug 15 01:21:46 2007 +0000
@@ -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 @@
        }
 
        /* 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;



Home | Main Index | Thread Index | Old Index