summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg>2008-02-07 23:40:52 +0000
committerjoerg <joerg>2008-02-07 23:40:52 +0000
commitf4b1f8f9e0f862a81125cf99da260443da0c2599 (patch)
treebdf0e4cfe2102d622a46910e42221e454aede609 /pkgtools
parenta433e3ad84fdec5867b17fcb4ae0e41248f42bea (diff)
downloadpkgsrc-f4b1f8f9e0f862a81125cf99da260443da0c2599.tar.gz
pkg_install-20080208:
Explicitly check in show_var that the buffer is non-NULL. This can stops pkg_info -Q foo from segfaulting for explicitly installed packages. Reported by Stoned Elipot.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/info/show.c7
-rw-r--r--pkgtools/pkg_install/files/lib/version.h4
2 files changed, 7 insertions, 4 deletions
diff --git a/pkgtools/pkg_install/files/info/show.c b/pkgtools/pkg_install/files/info/show.c
index cd3f04d273d..32d42589e30 100644
--- a/pkgtools/pkg_install/files/info/show.c
+++ b/pkgtools/pkg_install/files/info/show.c
@@ -1,4 +1,4 @@
-/* $NetBSD: show.c,v 1.20 2008/02/02 16:21:45 joerg Exp $ */
+/* $NetBSD: show.c,v 1.21 2008/02/07 23:40:52 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: show.c,v 1.11 1997/10/08 07:47:38 charnier Exp";
#else
-__RCSID("$NetBSD: show.c,v 1.20 2008/02/02 16:21:45 joerg Exp $");
+__RCSID("$NetBSD: show.c,v 1.21 2008/02/07 23:40:52 joerg Exp $");
#endif
#endif
@@ -138,6 +138,9 @@ show_var(const char *buf, const char *variable)
{
char *value;
+ if (buf == NULL)
+ return;
+
if ((value = var_get_memory(buf, variable)) != NULL) {
(void) printf("%s\n", value);
free(value);
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index 2e76d8b83c6..cad3a8d3ace 100644
--- a/pkgtools/pkg_install/files/lib/version.h
+++ b/pkgtools/pkg_install/files/lib/version.h
@@ -1,4 +1,4 @@
-/* $NetBSD: version.h,v 1.90 2008/02/04 14:03:10 joerg Exp $ */
+/* $NetBSD: version.h,v 1.91 2008/02/07 23:40:52 joerg Exp $ */
/*
* Copyright (c) 2001 Thomas Klausner. All rights reserved.
@@ -33,6 +33,6 @@
#ifndef _INST_LIB_VERSION_H_
#define _INST_LIB_VERSION_H_
-#define PKGTOOLS_VERSION "20080204"
+#define PKGTOOLS_VERSION "20080208"
#endif /* _INST_LIB_VERSION_H_ */