From a066e3b3805ae74f011d14300fbcda410d818452 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 19 Mar 2019 00:53:14 -0600 Subject: InetEndpoint: properly match IPv6 addresses The old one didn't account for trailing digits. Reported-by: Brandon Jackson --- app/src/main/java/com/wireguard/config/InetEndpoint.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3