[Content Filtering] Crash when allowing a 0-byte resource to load
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Oct 2015 00:01:34 +0000 (00:01 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Oct 2015 00:01:34 +0000 (00:01 +0000)
commita8c2efcf23a52126d9198c58cea06020169f6155
treed8fc57c7f55f1db43ee9a1e20152d2749441b798
parent953b85d709c0c582f1cb04290c9838fb3565e974
[Content Filtering] Crash when allowing a 0-byte resource to load
https://bugs.webkit.org/show_bug.cgi?id=150644
<rdar://problem/23288538>

Reviewed by Darin Adler.

Source/WebCore:

Test: contentfiltering/allow-empty-document.html

* loader/ContentFilter.cpp:
(WebCore::ContentFilter::deliverResourceData): resourceBuffer will be null if the resource contained no data.

LayoutTests:

* contentfiltering/allow-empty-document-expected.html: Added.
* contentfiltering/allow-empty-document.html: Added.
* contentfiltering/resources/empty.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/contentfiltering/allow-empty-document-expected.html [new file with mode: 0644]
LayoutTests/contentfiltering/allow-empty-document.html [new file with mode: 0644]
LayoutTests/contentfiltering/resources/empty.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/ContentFilter.cpp