From 456ce952f2ba8e6cb9c63ee211b2fa7db49d9529 Mon Sep 17 00:00:00 2001 From: Richard Walters Date: Fri, 9 Oct 2020 13:30:45 -0700 Subject: Fix bug in parsing IPv6 addresses Fix bug where an IPv6 address ending in a double-colon was not considered valid (it was being considered as truncated). --- src/Uri.cpp | 1 - src/lib.rs | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/Uri.cpp b/src/Uri.cpp index 3d8b4fa..2b15ede 100644 --- a/src/Uri.cpp +++ b/src/Uri.cpp @@ -370,7 +370,6 @@ namespace { (position == address.length()) && ( (state == ValidationState::COLON_BUT_NO_GROUPS_YET) - || (state == ValidationState::AFTER_COLON_EXPECT_GROUP_OR_IPV4) || (state == ValidationState::COLON_AFTER_GROUP) ) ) { // trailing single colon diff --git a/src/lib.rs b/src/lib.rs index ffb6c8b..cf48082 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -409,7 +409,6 @@ fn validate_ipv6_address(address: &str) -> Result<(), Error> { #[allow(unused_parens)] if ( (state == ValidationState::ColonButNoGroupsYet) - || (state == ValidationState::AfterColonExpectGroupOrIpv4) || (state == ValidationState::ColonAfterGroup) ) { // trailing single colon return Err(Error::IllegalCharacter); -- cgit v1.2.3