InetEndpoint: disallow huge ports
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
053ca232aa
commit
fe424197da
@ -51,7 +51,7 @@ public final class InetEndpoint {
|
|||||||
} catch (final URISyntaxException e) {
|
} catch (final URISyntaxException e) {
|
||||||
throw new IllegalArgumentException(e);
|
throw new IllegalArgumentException(e);
|
||||||
}
|
}
|
||||||
if (uri.getPort() < 0)
|
if (uri.getPort() < 0 || uri.getPort() > 65535)
|
||||||
throw new ParseException(InetEndpoint.class, endpoint, "Missing/invalid port number");
|
throw new ParseException(InetEndpoint.class, endpoint, "Missing/invalid port number");
|
||||||
try {
|
try {
|
||||||
InetAddresses.parse(uri.getHost());
|
InetAddresses.parse(uri.getHost());
|
||||||
|
Loading…
Reference in New Issue
Block a user