Handle Storage Access API calls in the absence of an attached frame
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2018 16:46:47 +0000 (16:46 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2018 16:46:47 +0000 (16:46 +0000)
commitd542200156f339bc433208f0e459c7541c1c18aa
treee5bf4d0e3b9dd58298daabda75a6af66453f5f32
parent00bcebe626b2b198822f3ac347c737ffe6ccdf0b
Handle Storage Access API calls in the absence of an attached frame
https://bugs.webkit.org/show_bug.cgi?id=186373
<rdar://problem/40028265>

Reviewed by Daniel Bates.

Source/WebCore:

Tests: http/tests/storageAccess/has-storage-access-crash.html
       http/tests/storageAccess/request-storage-access-crash.html

The new frame-specific storage access checks were done without confirming a
frame was present, although the frame state was validated in other parts of
the same method.

This patch checks for a non-null frame before making frame-specific calls.

* dom/Document.cpp:
(WebCore::Document::hasStorageAccess):
(WebCore::Document::requestStorageAccess):

LayoutTests:

* http/tests/storageAccess/has-storage-access-crash-expected.txt: Added.
* http/tests/storageAccess/has-storage-access-crash.html: Added.
* http/tests/storageAccess/request-storage-access-crash-expected.txt: Added.
* http/tests/storageAccess/request-storage-access-crash.html: Added.
* platform/mac-wk2/TestExpectations: Add the two new tests for HighSierra+

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/storageAccess/has-storage-access-crash-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/has-storage-access-crash.html [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/request-storage-access-crash-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/request-storage-access-crash.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp