diff options
author | wiz <wiz@pkgsrc.org> | 2006-04-04 06:24:39 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2006-04-04 06:24:39 +0000 |
commit | 864c7d4c3358bc371b5c588285f7f2415a386bab (patch) | |
tree | d9e67f2507b4c855d4ec380c6987256651d07a77 /pkgtools | |
parent | b6f92e0c47b6427e6fbed54de93c85019d596fe1 (diff) | |
download | pkgsrc-864c7d4c3358bc371b5c588285f7f2415a386bab.tar.gz |
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
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_install/files/add/perform.c | 8 |
1 files changed, 6 insertions, 2 deletions
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 { |