pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/48207: pkg_info segfaults when querying a package file



The following reply was made to PR pkg/48207; it has been noted by GNATS.

From: Thomas Klausner <wiz%NetBSD.org@localhost>
To: NetBSD bugtracking <gnats-bugs%NetBSD.org@localhost>
Cc: 
Subject: Re: pkg/48207: pkg_info segfaults when querying a package file
Date: Wed, 11 Sep 2013 17:33:11 +0200

 --HcAYCG3uE/tztfnV
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Wed, Sep 11, 2013 at 03:25:00PM +0000, Thomas Klausner wrote:
 > The following reply was made to PR pkg/48207; it has been noted by GNATS.
 > 
 > From: Thomas Klausner <wiz%NetBSD.org@localhost>
 > To: NetBSD bugtracking <gnats-bugs%NetBSD.org@localhost>
 > Cc: 
 > Subject: Re: pkg/48207: pkg_info segfaults when querying a package file
 > Date: Wed, 11 Sep 2013 17:24:16 +0200
 > 
 >  On Wed, Sep 11, 2013 at 02:30:01PM +0000, jmartin%basho.com@localhost wrote:
 >  > pkg_info it is throwing a segfault with one of our packages.
 >  > 
 >  > [root@smartos-base1310-64 /vagrant]# pkg_info -X 
 > riak_cs-1.4.1-SmartOS-x86_64.tgz
 >  > PKGNAME=riak_cs-1.4.1
 >  > CONFLICTS=riak_cs-*
 >  > DEPENDS=sudo-[0-9]*
 >  > DEPENDS=openssl-1.0.1*
 >  > DEPENDS=ncurses-5*
 >  > DEPENDS=gcc47-libs>=4.7.0
 >  > COMMENT=Riak CS
 >  > MACHINE_ARCH=x86_64
 >  > OPSYS=SunOS
 >  > OS_VERSION=5.11
 >  > PKGTOOLS_VERSION=20091115
 >  > Segmentation Fault (core dumped)
 >  
 >  How did you create the package?
 >  
 >  There is no trailing '\n' after "PKGTOOLS_VERSION=20091115", which is
 >  probably the reason of the coredump.
 >  
 >    meta_build_info = 0x7f7ff7b51100 
 > "ABI=64\nMACHINE_ARCH=x86_64\nMACHINE_GNU_ARCH=x86_64\nOBJECT_FMT=ELF\nOPSYS=SunOS\nOS_VERSION=5.11\nPKGTOOLS_VERSION=20091115",
 >  
 >  I agree that this should not cause a coredump, but I'd like to know
 >  how this came to be.
 
 Here's a diff that fixes the segfault for me.
  Thomas
 
 --HcAYCG3uE/tztfnV
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="pkg_install.diff"
 
 Index: files/lib/var.c
 ===================================================================
 RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/lib/var.c,v
 retrieving revision 1.9
 diff -u -r1.9 var.c
 --- files/lib/var.c    17 May 2013 07:27:29 -0000      1.9
 +++ files/lib/var.c    11 Sep 2013 15:32:35 -0000
 @@ -60,7 +60,7 @@
  static void var_print(FILE *, const char *, const char *);
  
  /*
 - * Copy the specified varibales from the file fname to stdout.
 + * Copy the specified variables from the file fname to stdout.
   */
  int
  var_copy_list(const char *buf, const char **variables)
 @@ -69,7 +69,7 @@
        size_t len;
        int i;
  
 -      for (; *buf; buf = next) {
 +      for (; buf && *buf; buf = next) {
                if ((eol = strchr(buf, '\n')) != NULL) {
                        next = eol + 1;
                        len = eol - buf;
 
 --HcAYCG3uE/tztfnV--
 


Home | Main Index | Thread Index | Old Index