summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/com/wireguard/config/InetEndpoint.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/config/InetEndpoint.java b/app/src/main/java/com/wireguard/config/InetEndpoint.java
index 06d0ca80..962d97c6 100644
--- a/app/src/main/java/com/wireguard/config/InetEndpoint.java
+++ b/app/src/main/java/com/wireguard/config/InetEndpoint.java
@@ -51,6 +51,8 @@ public final class InetEndpoint {
} catch (final URISyntaxException e) {
throw new IllegalArgumentException(e);
}
+ if (uri.getPort() < 0)
+ throw new IllegalArgumentException("An endpoint must specify a port (e.g. 51820)");
try {
InetAddresses.parse(uri.getHost());
// Parsing ths host as a numeric address worked, so we don't need to do DNS lookups.