| Summary: | /usr/bin/ftp program segfaults with following commandline | ||
|---|---|---|---|
| Product: | Base System | Reporter: | jweaver <jweaver> |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
jweaver
2001-01-31 00:00:01 UTC
On Tue, Jan 30, 2001 at 06:51:53PM -0500, jweaver@accountsupport.com wrote: > >Description: > Following http url commandline makes /usr/bin/ftp Segfault > > >How-To-Repeat: > bash-2.04$ ftp http://www.wfamaps.com/download.php?file=/pub/wfamaps/maps/map-2forts-wfa.zip > Requesting http://www.wfamaps.com/download.php?file=/pub/wfamaps/maps/map-2forts-wfa.zip > ftp: Error retrieving file: 404 Not Found > > ftp in free(): warning: junk pointer, too high to make sense. > Segmentation fault (core dumped) I confirm the bug under 4.2-STABLE. By the way, it works fine under -CURRENT, so you can try to backport some -CURRENT diffs. -- Alex Kapranoff, Voice: +7(0832)791845 We've lived 4 weeks in the brand new millenium... On Tue, Jan 30, 2001 at 11:00:08PM -0800, Alex Kapranoff wrote:
> The following reply was made to PR bin/24745; it has been noted by GNATS.
>
> From: Alex Kapranoff <kapr@acm.org>
> To: jweaver@accountsupport.com
> Cc: FreeBSD-gnats-submit@FreeBSD.ORG
> Subject: Re: bin/24745: ftp segfault condition
> Date: Wed, 31 Jan 2001 09:46:11 +0300
>
> On Tue, Jan 30, 2001 at 06:51:53PM -0500, jweaver@accountsupport.com wrote:
>
> > >Description:
> > Following http url commandline makes /usr/bin/ftp Segfault
> >
> > >How-To-Repeat:
> > bash-2.04$ ftp http://www.wfamaps.com/download.php?file=/pub/wfamaps/maps/map-2forts-wfa.zip
> > Requesting http://www.wfamaps.com/download.php?file=/pub/wfamaps/maps/map-2forts-wfa.zip
> > ftp: Error retrieving file: 404 Not Found
> >
> > ftp in free(): warning: junk pointer, too high to make sense.
> > Segmentation fault (core dumped)
>
> I confirm the bug under 4.2-STABLE. By the way, it works fine under
> -CURRENT, so you can try to backport some -CURRENT diffs.
Actually, this is pretty much the only difference between usr.bin/ftp/
in -stable and -current. Try the attached patch, it does the trick
for me.
G'luck,
Peter
--
because I didn't think of a good beginning of it.
Index: src/usr.bin/ftp/fetch.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/ftp/fetch.c,v
retrieving revision 1.12.2.2
diff -u -r1.12.2.2 fetch.c
--- src/usr.bin/ftp/fetch.c 2000/06/24 15:35:46 1.12.2.2
+++ src/usr.bin/ftp/fetch.c 2001/01/31 07:24:16
@@ -270,6 +270,7 @@
break;
}
freeaddrinfo(res0);
+ res0 = NULL;
/*
* Construct and send the request. We're expecting a return
State Changed From-To: open->closed Duplicate of PR bin/21476 (the latter was fixed). jweaver@accountsupport.com writes: > Following http url commandline makes /usr/bin/ftp Segfault Don't use ftp(1) for retrieving HTTP documents. It only pretends to work. Use fetch(1), which makes a pretty good attempt at really working. DES -- Dag-Erling Smorgrav - des@ofug.org |