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

[svn] Reject port numbers greater than 65535.

This commit is contained in:
hniksic 2005-03-06 08:34:00 -08:00
parent dbd0607ea8
commit f3aece8d22
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-03-06 Hrvoje Niksic <hniksic@xemacs.org>
* url.c (url_parse): Reject port numbers larger than 65535. We
also check for overflow while parsing port numbers.
2005-03-06 Hrvoje Niksic <hniksic@xemacs.org>
* utils.c (read_file): Don't use wgint for file size; LFS won't

View File

@ -781,6 +781,13 @@ url_parse (const char *url, int *error)
goto error;
}
port = 10 * port + (*pp - '0');
/* Check for too large port numbers here, before we have
a chance to overflow on bogus port values. */
if (port > 65535)
{
error_code = PE_BAD_PORT_NUMBER;
goto error;
}
}
}
}