Bug 22401

Summary: pkg_add -r does a segmentation fault
Product: Base System Reporter: cjuniet <cjuniet>
Component: binAssignee: Dag-Erling Smørgrav <des>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1.1-STABLE   
Hardware: Any   
OS: Any   

Description cjuniet 2000-10-29 23:40:00 UTC
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.

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)
How-To-Repeat: pkg_add -r foo
Comment 1 bill fumerola freebsd_committer freebsd_triage 2000-10-29 23:47:59 UTC
Responsible Changed
From-To: freebsd-bugs->des

Dag-Erling already committed a fix (of a fix) in -current, 
I suppose this serves as a reminder to merge before 4.2-RELEASE
Comment 2 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2000-10-30 19:35:26 UTC
State Changed
From-To: open->closed

Already fixed.