diff --git a/src/url_aggregator.cpp b/src/url_aggregator.cpp index 2b761ad34..e9a3a1546 100644 --- a/src/url_aggregator.cpp +++ b/src/url_aggregator.cpp @@ -898,7 +898,7 @@ bool url_aggregator::parse_ipv4(std::string_view input) { // We have the last value. // At this stage, ipv4 contains digit_count*8 bits. // So we have 32-digit_count*8 bits left. - if (segment_result > (uint64_t(1) << (32 - digit_count * 8))) { + if (segment_result >= (uint64_t(1) << (32 - digit_count * 8))) { return is_valid = false; } ipv4 <<= (32 - digit_count * 8); diff --git a/tests/basic_tests.cpp b/tests/basic_tests.cpp index c3cb1e417..4f44badc8 100644 --- a/tests/basic_tests.cpp +++ b/tests/basic_tests.cpp @@ -399,6 +399,6 @@ TYPED_TEST(basic_tests, nodejs_50235) { // https://github.com/nodejs/node/issues/51514 TYPED_TEST(basic_tests, nodejs_51514) { - auto out = ada::parse("http://1.1.1.256"); + auto out = ada::parse("http://1.1.1.256"); ASSERT_FALSE(out); }