1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Don't call rate() with bogus data.

Submitted by Ian Abbott in <3B7A98A1.24985.9EF692@localhost>
This commit is contained in:
hniksic 2001-11-16 11:38:03 -08:00
parent 90cdb82942
commit fa6aeb869d
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2001-08-15 Ian Abbott <abbotti@mev.co.uk>
* ftp.c (ftp_loop_internal): Avoid a potential buffer overflow in
the call to the 'rate' function by moving it past the error
checking for the 'getftp' function return value.
2001-11-16 Hrvoje Niksic <hniksic@arsdigita.com>
* html-parse.c (advance_declaration): Use 0x22 instead of '"' or

View File

@ -1086,9 +1086,6 @@ ftp_loop_internal (struct urlinfo *u, struct fileinfo *f, ccon *con)
else
len = 0;
err = getftp (u, &len, restval, con);
/* Time? */
tms = time_str (NULL);
tmrate = rate (len - restval, con->dltime, 0);
if (!rbuf_initialized_p (&con->rbuf))
con->st &= ~DONE_CWD;
@ -1126,6 +1123,9 @@ ftp_loop_internal (struct urlinfo *u, struct fileinfo *f, ccon *con)
/* Not as great. */
abort ();
}
/* Time? */
tms = time_str (NULL);
tmrate = rate (len - restval, con->dltime, 0);
/* If we get out of the switch above without continue'ing, we've
successfully downloaded a file. Remember this fact. */