aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-12-10 15:54:38 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-12-10 15:54:38 +0100
commite69e84ae03b59496cdd9f462a203cbd0e408abcd (patch)
treeba296ac06c30d07fb4db53fe572a126256adf545
parentExport actual configuration for zips (diff)
downloadwireguard-android-e69e84ae03b59496cdd9f462a203cbd0e408abcd.tar.xz
wireguard-android-e69e84ae03b59496cdd9f462a203cbd0e408abcd.zip
Do not allow for an empty port in endpoint
-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 06d0ca8..962d97c 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.