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 pkg_install-20080208:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/705f73fafab0
branches:  trunk
changeset: 538427:705f73fafab0
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Feb 07 23:40:52 2008 +0000

description:
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:

 pkgtools/pkg_install/files/info/show.c   |  7 +++++--
 pkgtools/pkg_install/files/lib/version.h |  4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r 67e468aea1f3 -r 705f73fafab0 pkgtools/pkg_install/files/info/show.c
--- a/pkgtools/pkg_install/files/info/show.c    Thu Feb 07 22:27:53 2008 +0000
+++ b/pkgtools/pkg_install/files/info/show.c    Thu Feb 07 23:40:52 2008 +0000
@@ -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 @@
 {
        char   *value;
 
+       if (buf == NULL)
+               return;
+
        if ((value = var_get_memory(buf, variable)) != NULL) {
                (void) printf("%s\n", value);
                free(value);
diff -r 67e468aea1f3 -r 705f73fafab0 pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Thu Feb 07 22:27:53 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Thu Feb 07 23:40:52 2008 +0000
@@ -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_ */



Home | Main Index | Thread Index | Old Index