From owner-freebsd-current Mon Aug 26 0:37:13 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA57537B400; Mon, 26 Aug 2002 00:37:08 -0700 (PDT) Received: from shale.csir.co.za (shale.csir.co.za [146.64.46.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id E65FE43E3B; Mon, 26 Aug 2002 00:37:01 -0700 (PDT) (envelope-from reg@shale.csir.co.za) Received: (from reg@localhost) by shale.csir.co.za (8.11.6/8.11.6) id g7Q7aM760249; Mon, 26 Aug 2002 09:36:22 +0200 (SAT) (envelope-from reg) Date: Mon, 26 Aug 2002 09:36:22 +0200 From: Jeremy Lea To: "David W. Chapman Jr." Cc: current@FreeBSD.ORG, ports@FreeBSD.ORG Subject: Re: pkg_version and no origin found == SEGFAULT Message-ID: <20020826093622.A60230@shale.csir.co.za> References: <20020825164731.GA88696@leviathan.inethouston.net> <20020825130007.35cdd0b9.ak03@gte.com> <20020825171350.GA89121@leviathan.inethouston.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020825171350.GA89121@leviathan.inethouston.net>; from dwcjr@inethouston.net on Sun, Aug 25, 2002 at 12:13:50PM -0500 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, On Sun, Aug 25, 2002 at 12:13:50PM -0500, David W. Chapman Jr. wrote: > This is exactly the problem I'm seeing and would explain why > portupgrade -f fixes the problem for the port that causes the segfault. > Shouldn't pkg_version handle this a little more gracefully? Can someone with a src commit bit please do the honours... Index: perform.c =================================================================== RCS file: /usr/home/ncvs/src/usr.sbin/pkg_install/version/perform.c,v retrieving revision 1.1 diff -u -r1.1 perform.c --- perform.c 24 Jun 2002 16:03:24 -0000 1.1 +++ perform.c 26 Jun 2002 19:24:18 -0000 @@ -109,6 +109,10 @@ } read_plist(&plist, fp); fclose(fp); + if (plist.name == NULL) { + warnx("%s does not appear to be a valid package!", pkg); + return 1; + } /* * First we check if the installed package has an origin, and try Regards, -Jeremy -- FreeBSD - Because the best things in life are free... http://www.freebsd.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message