URLParser should fail when parsing invalid relative URLs with no schemes
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2016 20:19:07 +0000 (20:19 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2016 20:19:07 +0000 (20:19 +0000)
commitb1f5ec5f26f00cb59fef76811e650856f47e5415
tree237d422ab347fee39f26cb1ea6af5e79b38a1ab3
parent7fe81141b639f4b2566e657016bfb7ab5729aad5
URLParser should fail when parsing invalid relative URLs with no schemes
https://bugs.webkit.org/show_bug.cgi?id=162355

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::copyASCIIStringUntil):
When copying from a null String, is8Bit dereferences a null pointer.  We don't want to do that.
(WebCore::URLParser::parse):
What the spec calls a "null" URL matches !url.isValid(), not url.isNull().
The former reflects whether the parsing succeeded,
the latter whether the contained String (which could be an invalid URL) is null.

Tools:

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

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