aboutsummaryrefslogtreecommitdiffstats
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
parentlibwg-go: bump (diff)
downloadwireguard-android-a066e3b3805ae74f011d14300fbcda410d818452.tar.xz
wireguard-android-a066e3b3805ae74f011d14300fbcda410d818452.zip
InetEndpoint: properly match IPv6 addresses
The old one didn't account for trailing digits. Reported-by: Brandon Jackson <bjackson@napshome.net>
-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 ffb32ec..a442258 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;