From owner-freebsd-current Tue Feb 4 15:50:33 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id PAA24866 for current-outgoing; Tue, 4 Feb 1997 15:50:33 -0800 (PST) Received: from terminator.informatik.ba-stuttgart.de (terminator.informatik.ba-stuttgart.de [141.31.1.21]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA24835 for ; Tue, 4 Feb 1997 15:50:17 -0800 (PST) Received: from helbig.informatik.ba-stuttgart.de (helbig.informatik.ba-stuttgart.de [141.31.166.22]) by terminator.informatik.ba-stuttgart.de (8.7.6/8.7.3) with ESMTP id XAA13707; Tue, 4 Feb 1997 23:49:30 +0100 Received: (from helbig@localhost) by helbig.informatik.ba-stuttgart.de (8.8.5/8.8.4) id AAA00467; Wed, 5 Feb 1997 00:50:00 +0100 (MET) From: Wolfgang Helbig Message-Id: <199702042350.AAA00467@helbig.informatik.ba-stuttgart.de> Subject: Re: fetch segmentation fault In-Reply-To: <9702041528.AA22127@halloran-eldar.lcs.mit.edu> from Garrett Wollman at "Feb 4, 97 10:28:37 am" To: wollman@lcs.mit.edu (Garrett Wollman) Date: Wed, 5 Feb 1997 00:50:00 +0100 (MET) Cc: current@freebsd.org X-Mailer: ELM [version 2.4ME+ PL30 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > < said: > > > fetch isn't working in current since yesterday Feb 3 for me. > > It faults every time with "Segmentation fault". > > Please provide more information. > > -GAWollman > if you do fetch ftp://arnold/mbox you will get a seg-fault. This is because in ftp.c line 355 we have fs->fs_outputfile == 1, which is an invalid address. Fix: Index: ftp.c =================================================================== RCS file: /usr/cvsroot/src/usr.bin/fetch/ftp.c,v retrieving revision 1.1 diff -c -r1.1 ftp.c *** ftp.c 1997/01/30 21:43:40 1.1 --- ftp.c 1997/02/04 23:29:51 *************** *** 146,152 **** if (fs->fs_outputfile == 0) { slash = strrchr(p, '/'); ! fs->fs_outputfile = slash + 1; } ftps->ftp_password = getenv("FTP_PASSWORD"); --- 146,155 ---- if (fs->fs_outputfile == 0) { slash = strrchr(p, '/'); ! if (slash == NULL) ! fs->fs_outputfile = p; ! else ! fs->fs_outputfile = slash + 1; } ftps->ftp_password = getenv("FTP_PASSWORD"); Wolfgang Helbig