From 314836a37845eb93ea43a302998128219d381ea4 Mon Sep 17 00:00:00 2001 From: wiz Date: Tue, 4 Apr 2006 06:24:39 +0000 Subject: Pull over 1.117 from src/usr.sbin: revision 1.117 date: 2006/03/17 02:37:31; author: hubertf; state: Exp; lines: +6 -2 Add sanity check if there's a @cwd in the +CONTENT file. If not abort, because we wouldn't know where to put the files. Coverity CID 1358 --- pkgtools/pkg_install/files/add/perform.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pkgtools/pkg_install') diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c index 71cdf6fabf4..334f0979249 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.38 2006/03/13 22:08:22 erh Exp $ */ +/* $NetBSD: perform.c,v 1.39 2006/04/04 06:24:39 wiz 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.38 2006/03/13 22:08:22 erh Exp $"); +__RCSID("$NetBSD: perform.c,v 1.39 2006/04/04 06:24:39 wiz Exp $"); #endif #endif @@ -500,6 +500,10 @@ pkg_do(const char *pkg, lpkg_head_t *pkgs) */ if (is_depoted_pkg) { p = find_plist(&Plist, PLIST_CWD); + if (p == NULL) { + warn("no @cwd in +CONTENTS file?! aborting."); + goto bomb; + } (void) strlcpy(dbdir, dirname_of(p->name), sizeof(dbdir)); (void) strlcpy(LogDir, p->name, sizeof(LogDir)); } else { -- cgit v1.2.3