From 8600fe34174cb1c004dea73c22384cdbfda5c7b2 Mon Sep 17 00:00:00 2001 From: Richard Walters Date: Wed, 4 Jul 2018 20:14:38 -0700 Subject: Fix bug in IPv6Address validation A trailing group which is definitely not an IPv4Address needs to be counted. Detect this as the state being IN_GROUP_NOT_IPV4 after the end of the string. --- src/Uri.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Uri.cpp b/src/Uri.cpp index 191aafd..73bdfc3 100644 --- a/src/Uri.cpp +++ b/src/Uri.cpp @@ -381,8 +381,10 @@ namespace { } ++position; } - // TODO: should also catch IN_GROUP_NOT_IPV4 - if (state == ValidationState::IN_GROUP_COULD_BE_IPV4) { + if ( + (state == ValidationState::IN_GROUP_NOT_IPV4) + || (state == ValidationState::IN_GROUP_COULD_BE_IPV4) + ) { // count trailing group ++numGroups; } -- cgit v1.2.3