Skip to content

Commit 4f8fd38

Browse files
committed
Added test to prevent nested IPV4 with more than 4 octets
1 parent 29779b8 commit 4f8fd38

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/unit/http_utils_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ LT_BEGIN_AUTO_TEST(http_utils_suite, ip_representation6_str_invalid_nested_beyon
386386
LT_CHECK_THROW(http::ip_representation("::ffff:192.0.256.128"));
387387
LT_END_AUTO_TEST(ip_representation6_str_invalid_nested_beyond255)
388388

389+
LT_BEGIN_AUTO_TEST(http_utils_suite, ip_representation6_str_invalid_nested_more_than_4_parts)
390+
LT_CHECK_THROW(http::ip_representation("::ffff:192.0.5.128.128"));
391+
LT_END_AUTO_TEST(ip_representation6_str_invalid_nested_more_than_4_parts)
392+
389393
LT_BEGIN_AUTO_TEST(http_utils_suite, ip_representation6_str_invalid_nested_not_at_end)
390394
LT_CHECK_THROW(http::ip_representation("::ffff:192.0.256.128:ffff"));
391395
LT_END_AUTO_TEST(ip_representation6_str_invalid_nested_not_at_end)

0 commit comments

Comments
 (0)