Fix possible out-of-bounds read in protocolIsInHTTPFamily
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Dec 2017 01:54:26 +0000 (01:54 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Dec 2017 01:54:26 +0000 (01:54 +0000)
commitd4a83f3f5c8e78b20d2bfa2e4e0be2363f8a4558
treea788b569f255484fe18fb8dd0f6771944f4ef6c4
parentaae7057dfbf7e21879a6fe1fcb5e700aa753e906
Fix possible out-of-bounds read in protocolIsInHTTPFamily
https://bugs.webkit.org/show_bug.cgi?id=180688

Reviewed by Daniel Bates.

Source/WebCore:

It wouldn't read very far out of bounds, and it would just change a bool return value,
but it's still out of bounds.  Covered by an API test that ASAN wouldn't like.

* platform/URL.cpp:
(WebCore::protocolIsInHTTPFamily):
Check bounds before reading a string.

Tools:

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

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