summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-19 00:53:14 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-19 00:53:14 -0600
commit76305045db5c816b2b9212cc95e040cea8d47c38 (patch)
treee6fd7e856dceee451b0c0c9356a3a61d0144155b
parentc4ba48d7a93878d5b663933aec217f416d9bfd68 (diff)
InetEndpoint: properly match IPv6 addresses
The old one didn't account for trailing digits. Reported-by: Brandon Jackson <bjackson@napshome.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-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 ffb32ec4..a442258e 100644
--- a/app/src/main/java/com/wireguard/config/InetEndpoint.java
+++ b/app/src/main/java/com/wireguard/config/InetEndpoint.java
@@ -26,7 +26,7 @@ import java9.util.Optional;
* Instances of this class are externally immutable.
*/
public final class InetEndpoint {
- private static final Pattern BARE_IPV6 = Pattern.compile("^[^\\[]*:");
+ private static final Pattern BARE_IPV6 = Pattern.compile("^[^\\[\\]]*:[^\\[\\]]*");
private static final Pattern FORBIDDEN_CHARACTERS = Pattern.compile("[/?#]");
private final String host;