Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Feb 1997 00:50:00 +0100 (MET)
From:      Wolfgang Helbig <helbig@helbig.informatik.ba-stuttgart.de>
To:        wollman@lcs.mit.edu (Garrett Wollman)
Cc:        current@freebsd.org
Subject:   Re: fetch segmentation fault
Message-ID:  <199702042350.AAA00467@helbig.informatik.ba-stuttgart.de>
In-Reply-To: <9702041528.AA22127@halloran-eldar.lcs.mit.edu> from Garrett Wollman at "Feb 4, 97 10:28:37 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> <<On Tue, 4 Feb 1997 09:49:09 +0100 (MET), Werner Griessl <croot@btp1da.phy.uni-bayreuth.de> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702042350.AAA00467>