diff options
author | joerg <joerg@pkgsrc.org> | 2008-02-07 23:40:52 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2008-02-07 23:40:52 +0000 |
commit | e08e39667b3795905e2c06ac83280a17a2fc4739 (patch) | |
tree | bdf0e4cfe2102d622a46910e42221e454aede609 /pkgtools | |
parent | e9ce48a4110616b3516cdddf212f1e9d271895b0 (diff) | |
download | pkgsrc-e08e39667b3795905e2c06ac83280a17a2fc4739.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.c | 7 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/version.h | 4 |
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_ */ |