1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

AK: Check for overflow parsing IPv4 number in URL

Fixes OSS fuzz issue:
https://oss-fuzz.com/download?testcase_id=6045676088459264
This commit is contained in:
Shannon Booth 2023-10-04 21:17:00 +13:00 committed by Andreas Kling
parent 453dd0cf44
commit 3748f1d290
2 changed files with 15 additions and 5 deletions

View file

@ -535,4 +535,10 @@ TEST_CASE(ipv4_address)
EXPECT(url.is_valid());
EXPECT_EQ(MUST(url.serialized_host()), "52.251.94.56"sv);
}
{
constexpr auto ipv4_url = "http://9111111111"sv;
URL url(ipv4_url);
EXPECT(!url.is_valid());
}
}