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



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3542d404506a
branches:  trunk
changeset: 538984:3542d404506a
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Fri Feb 22 15:53:52 2008 +0000

description:
pkg_install-20080222:
Free libarchive's side of the package before closing the file descriptor.
This stops leaking up to 1MB / package when using bzip2 and addresses
PR 38082. Check that at least +COMMENTS, +CONTENTS and +DESC can be
extracted, otherwise skip the entry. This stops pkg_info -X from dumping
core on non-package files.

diffstat:

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

diffs (59 lines):

diff -r b89d1cf6821a -r 3542d404506a pkgtools/pkg_install/files/info/perform.c
--- a/pkgtools/pkg_install/files/info/perform.c Fri Feb 22 15:46:51 2008 +0000
+++ b/pkgtools/pkg_install/files/info/perform.c Fri Feb 22 15:53:52 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.42 2008/02/05 18:57:09 joerg Exp $       */
+/*     $NetBSD: perform.c,v 1.43 2008/02/22 15:53:52 joerg Exp $       */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -17,7 +17,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.23 1997/10/13 15:03:53 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.42 2008/02/05 18:57:09 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.43 2008/02/22 15:53:52 joerg Exp $");
 #endif
 #endif
 
@@ -234,6 +234,8 @@
                (*target)[size] = '\0';
        }
 
+       archive_read_finish(archive);
+
        return meta;
 #endif
 }
@@ -360,6 +362,14 @@
                meta = read_meta_data_from_pkgdb(pkg);
        }
 
+       if (meta->meta_contents == NULL ||
+           meta->meta_comment == NULL ||
+           meta->meta_desc == NULL) {
+               warnx("invalid package `%s' skipped", pkg);
+               free_pkg_meta(meta);
+               return 1;       
+       }
+
        /*
          * Index is special info type that has to override all others to make
          * any sense.
diff -r b89d1cf6821a -r 3542d404506a pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Fri Feb 22 15:46:51 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Fri Feb 22 15:53:52 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.92 2008/02/19 15:16:24 joerg Exp $       */
+/*     $NetBSD: version.h,v 1.93 2008/02/22 15:53: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 "20080219"
+#define PKGTOOLS_VERSION "20080222"
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index