InetEndpoint: disallow huge ports
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
1 parent
053ca232aa
commit
fe424197da
1 file changed
+1
-1
@@ -51,7 +51,7 @@ public final class InetEndpoint {
|
||||
} catch (final URISyntaxException 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");
|
||||
try {
|
||||
InetAddresses.parse(uri.getHost());
|
||||
|
||||
Reference in new issue
Block a user