From fe424197da2dd66f271efc6e5807b4cf5a70376c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 15 Dec 2018 22:05:43 +0100 Subject: [PATCH] InetEndpoint: disallow huge ports Signed-off-by: Jason A. Donenfeld --- 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());