mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Fix loop check in FTP code
Reported-by: Coverity scanner
This commit is contained in:
parent
c6ee033425
commit
18fe274e1c
@ -1,3 +1,9 @@
|
||||
2014-11-19 Tim Ruehsen <tim.ruehsen@gmx.de>
|
||||
|
||||
* ftp-basic.c (ftp_epsv): Fix loop check
|
||||
|
||||
Reported-by: Coverity scanner
|
||||
|
||||
2014-11-19 Darshit Shah <darnir@gmail.com>
|
||||
|
||||
* exits.c (get_status_for_err): GATEWAYTIMEOUT is a Server Error and Wget's
|
||||
|
@ -784,15 +784,13 @@ ftp_epsv (int csock, ip_address *ip, int *port)
|
||||
}
|
||||
|
||||
/* Finally, get the port number */
|
||||
tport = 0;
|
||||
for (i = 1; c_isdigit (*s); s++)
|
||||
{
|
||||
if (i > 5)
|
||||
{
|
||||
xfree (respline);
|
||||
return FTPINVPASV;
|
||||
}
|
||||
for (tport = 0, i = 0; i < 5 && c_isdigit (*s); i++, s++)
|
||||
tport = (*s - '0') + 10 * tport;
|
||||
|
||||
if (i >= 5)
|
||||
{
|
||||
xfree (respline);
|
||||
return FTPINVPASV;
|
||||
}
|
||||
|
||||
/* Make sure that the response terminates correcty */
|
||||
|
Loading…
Reference in New Issue
Block a user