summaryrefslogtreecommitdiffhomepage
path: root/app/src
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
commita066e3b3805ae74f011d14300fbcda410d818452 (patch)
treee6fd7e856dceee451b0c0c9356a3a61d0144155b /app/src
parent53e354fa4b9e80015d3cfd2b3250f2b7caae8572 (diff)
InetEndpoint: properly match IPv6 addresses
The old one didn't account for trailing digits. Reported-by: Brandon Jackson <bjackson@napshome.net>
Diffstat (limited to 'app/src')
-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;