From owner-freebsd-bugs Tue Jan 30 23:40:25 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 75DCC37B6C7 for ; Tue, 30 Jan 2001 23:40:03 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f0V7e3M28976; Tue, 30 Jan 2001 23:40:03 -0800 (PST) (envelope-from gnats) Date: Tue, 30 Jan 2001 23:40:03 -0800 (PST) Message-Id: <200101310740.f0V7e3M28976@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Peter Pentchev Subject: Re: bin/24745: ftp segfault condition Reply-To: Peter Pentchev Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/24745; it has been noted by GNATS. From: Peter Pentchev To: Alex Kapranoff Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: bin/24745: ftp segfault condition Date: Wed, 31 Jan 2001 09:25:35 +0200 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 > 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message