From 87ae5a9f02cefc51fb24305ec79d37e4da40c4f0 Mon Sep 17 00:00:00 2001 From: Richard Walters Date: Fri, 9 Oct 2020 13:28:01 -0700 Subject: Fix bug in IPv6 address parsing Fix bug where IPv6 address ending in a group with only digits followed by a double-colon would not get parsed correctly --- src/Uri.cpp | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Uri.cpp b/src/Uri.cpp index a556276..3d8b4fa 100644 --- a/src/Uri.cpp +++ b/src/Uri.cpp @@ -316,7 +316,7 @@ namespace { if (c == ':') { numDigits = 0; ++numGroups; - state = ValidationState::AFTER_COLON_EXPECT_GROUP_OR_IPV4; + state = ValidationState::COLON_AFTER_GROUP; } else if (c == '.') { ipv4AddressEncountered = true; break; diff --git a/src/lib.rs b/src/lib.rs index 7540e21..ffb6c8b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -358,7 +358,7 @@ fn validate_ipv6_address(address: &str) -> Result<(), Error> { if c == ':' { num_digits = 0; num_groups += 1; - ValidationState::AfterColonExpectGroupOrIpv4 + ValidationState::ColonAfterGroup } else if c == '.' { ipv4_address_encountered = true; break; -- cgit v1.2.3