aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-12-15 22:05:43 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-12-15 22:05:43 +0100
commit26c2740e3d4c3cd1666fe846c90dd7b0180a9e1a (patch)
tree3f91a2024f59a22b2b5b3871686e7d1e114b11b0
parentAdjust code generation to match existing style (diff)
downloadwireguard-android-26c2740e3d4c3cd1666fe846c90dd7b0180a9e1a.tar.xz
wireguard-android-26c2740e3d4c3cd1666fe846c90dd7b0180a9e1a.zip
InetEndpoint: disallow huge ports
-rw-r--r--app/src/main/java/com/wireguard/config/InetEndpoint.java2
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 f64bc25..5f6a90d 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());