URLs with mismatched surrogate pairs in the host should fail to parse
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Sep 2018 21:58:29 +0000 (21:58 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Sep 2018 21:58:29 +0000 (21:58 +0000)
commit8f0f876e75948b8b7b20dcd2501338fbe9a2b30c
tree71ebc477bb5937d10df3b14731185e7cb8e91bae
parente123a4bf768c0bc7b0284f60c23a25152949b6b9
URLs with mismatched surrogate pairs in the host should fail to parse
https://bugs.webkit.org/show_bug.cgi?id=190005

Reviewed by Chris Dumez.

Source/WebCore:

Elsewhere in the URLParser, when we encounter mismatched surrogate pairs we use the replacement character,
but that just fails later on in domainToASCII, so we may as well just fail.
This behavior matches Chrome, but is unclear in the spec.  There are no valid uses of hosts containing mismatched surrogate pairs.
Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):

Tools:

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

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