From nobody@FreeBSD.ORG  Sun Oct 29 15:30:54 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id D3D5D37B479; Sun, 29 Oct 2000 15:30:54 -0800 (PST)
Message-Id: <20001029233054.D3D5D37B479@hub.freebsd.org>
Date: Sun, 29 Oct 2000 15:30:54 -0800 (PST)
From: cjuniet@yahoo.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: pkg_add -r does a segmentation fault
X-Send-Pr-Version: www-1.0

>Number:         22401
>Category:       bin
>Synopsis:       pkg_add -r does a segmentation fault
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 29 15:40:00 PST 2000
>Closed-Date:    Mon Oct 30 11:35:26 PST 2000
>Last-Modified:  Mon Oct 30 11:35:40 PST 2000
>Originator:     Christophe Juniet
>Release:        4.1.1-STABLE i386
>Organization:
>Environment:
FreeBSD quark.dyndns.org 4.1.1-STABLE
FreeBSD 4.1.1-STABLE #0: Sun Oct 29 13:22:35 CET 2000
root@quark.dyndns.org:/usr/src/sys/compile/QUARK  i386
>Description:
On -STABLE, since revision 1.16.2.10, pkg_add -r does a segmentation
fault if it is given any argument.

In /usr/src/lib/libfetch/ftp.c, line 890
if (!strchr(flags, 'd') && (purl = _ftp_get_proxy()) != NULL)
does a segmentation fault because flags is NULL.
>How-To-Repeat:
pkg_add -r foo
>Fix:
In /usr/src/lib/libfetch/ftp.c, lines 890 and 937 and 971 should be
if (!(flags && strchr(flags, 'd')) && (purl = _ftp_get_proxy()) != NULL)
or it should use CHECK_FLAG as in -CURRENT
if (!CHECK_FLAG('d') && (purl = _ftp_get_proxy()) != NULL)

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: billf 
Responsible-Changed-When: Sun Oct 29 15:47:59 PST 2000 
Responsible-Changed-Why:  
Dag-Erling already committed a fix (of a fix) in -current, 
I suppose this serves as a reminder to merge before 4.2-RELEASE 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22401 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Mon Oct 30 11:35:26 PST 2000 
State-Changed-Why:  
Already fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22401 
>Unformatted:
