From 26c2740e3d4c3cd1666fe846c90dd7b0180a9e1a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 15 Dec 2018 22:05:43 +0100 Subject: InetEndpoint: disallow huge ports --- app/src/main/java/com/wireguard/config/InetEndpoint.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()); -- cgit v1.2.3