When parsing an IPv4 address, wait until after deciding it is indeed an IPv4 address...
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jul 2019 19:15:04 +0000 (19:15 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jul 2019 19:15:04 +0000 (19:15 +0000)
commit124e45e60aa9c754d8b1f9d16103b12c67bd5916
tree6d6fc8108d978317608f6b70d1655c59d93de0c9
parentd1441aa92d4d6452b9f9921638d226f69d93ff47
When parsing an IPv4 address, wait until after deciding it is indeed an IPv4 address before reporting syntax violations
https://bugs.webkit.org/show_bug.cgi?id=199628

Reviewed by Brady Eidson.

Source/WTF:

Otherwise, we sometimes report syntax violations on things that are not IPv4 addresses and don't have syntax violations.
I added a unit test with one such URL that used to cause an assertion.

* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv4Host):

Tools:

* TestWebKitAPI/Tests/WTF/URLParser.cpp:
(TestWebKitAPI::TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/URLParser.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp