From 76305045db5c816b2b9212cc95e040cea8d47c38 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 Signed-off-by: Jason A. Donenfeld --- app/src/main/java/com/wireguard/config/InetEndpoint.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/src') 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