[BusyBox] ftpget fails on SIZE command
Glenn McGrath
bug1 at iinet.net.au
Tue May 4 10:47:03 UTC 2004
On Mon, 3 May 2004 20:05:41 -0400
"Sauder, Vernon" <Vernon.Sauder at spirentcom.com> wrote:
> The SIZE command seems to be failing on FTPGET. I traced it to the use
> of safe_strtoul where the endptr is checked against valid values.
> Since the buffer passed is the response to the SIZE command, it will
> probably contain a new line character. I search for a carriage-return
> and terminate the buffer there. I noticed that some other commands
> have this problem too so maybe a more generic change is in order.
> Anyway, here is the quick fix.
Thanks, your fixes jogged my memory, there was a recent problem fixed
with wget that is the same.
Acording to the RFC's ftp commands must end with \r\n, we wernt
stripping out the \r which made safe_strtoul return an error even though
it had converted the data correctly.
Your fix would be smaller, but i think my fix is technically better, and
one day i think we should merge ftpcmd() from wget and ftpgetput, so
good to keep them in sync.
Glenn
More information about the busybox
mailing list