diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-15 22:05:43 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-12-15 22:05:43 +0100 |
commit | 26c2740e3d4c3cd1666fe846c90dd7b0180a9e1a (patch) | |
tree | 3f91a2024f59a22b2b5b3871686e7d1e114b11b0 /app/src/main/java/com/wireguard | |
parent | de98eab1766bd2af789f0f1b8acad0cb8f089c57 (diff) |
InetEndpoint: disallow huge ports
Diffstat (limited to 'app/src/main/java/com/wireguard')
-rw-r--r-- | app/src/main/java/com/wireguard/config/InetEndpoint.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/config/InetEndpoint.java b/app/src/main/java/com/wireguard/config/InetEndpoint.java index f64bc25a..5f6a90d5 100644 --- a/app/src/main/java/com/wireguard/config/InetEndpoint.java +++ b/app/src/main/java/com/wireguard/config/InetEndpoint.java @@ -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()); |