Subject: bin/3157: ftp dumps core if you try to get a zero length file
To: None <gnats-bugs@gnats.netbsd.org>
From: None <frueauf@ira.uka.de>
List: netbsd-bugs
Date: 01/29/1997 13:49:33
>Number:         3157
>Category:       bin
>Synopsis:       ftp dumps core if you try to get a zero length file
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 29 04:50:01 1997
>Last-Modified:
>Originator:     Thorsten Frueauf
>Organization:
private
	
>Release:        NetBSD current 27.01.1997
>Environment:
	
NetBSD cyberlap 1.2B NetBSD 1.2B (CYBERLAP) #3: Tue Jan 28 11:11:47 CET 1997     frueauf@cyberlap:/usr/src/sys/arch/i386/compile/CYBERLAP i386


>Description:
	
If you try to get a zero length file with ftp, it dumps core with a 
Floating exception.

>How-To-Repeat:
	
Try the following:
on host A: `toch crash` # make a zero length file
on host B: `ftp hostA`
           get crash

and watch:
ftp> dir crash
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
-rw-------  1 frueauf  gr41            0 Jan 29 13:29 crash
226 Transfer complete.
ftp> get crash
local: crash remote: crash
200 PORT command successful.
150 Opening BINARY mode data connection for crash (0 bytes).
Floating exception (core dumped)

-rw-------  1 frueauf  gr41  483700 Jan 29 13:30 ftp.core
ore was generated by `ftp'.
Program terminated with signal 8, Floating point exception.
#0  0x1007ab65 in ?? ()

>Fix:
	
Had no time to look at it, sorry
>Audit-Trail:
>Unformatted:
ftp dumps core if you try to get a zero length file