Bug 18804

Summary: error in usr.bin/ftp/main.c ?
Product: Base System Reporter: tludwig <tludwig>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   

Description tludwig 2000-05-25 10:00:01 UTC
	in usr.bin/ftp/main.c at line 407, there is a test
	for a newline character in a string pointed to by
	the variable 'line'.  

	if (line[--num] == '\n') {

	Unfortunately the string that should be checked is 
	pointed to by 'line', not 'buf'.

Fix: 

replace line 407 in usr.bin/ftp/main.c by

	if (buf[--num] == '\n') {
Comment 1 alex 2000-05-25 10:28:22 UTC
Also sprach tludwig@urbanet.ch (tludwig@urbanet.ch):

> 	if (line[--num] == '\n') {
> 	Unfortunately the string that should be checked is 
> 	pointed to by 'line', not 'buf'.

It seems as if you are right.
The following occurencies of line must be changed to buf then, too, up
to the memcpy.

Alex
Comment 2 Poul-Henning Kamp freebsd_committer freebsd_triage 2001-05-29 10:26:57 UTC
State Changed
From-To: open->closed

fixed in rev 1.27 by se.