haikuwebkit/LayoutTests/loader
Julian Gonzalez 327de6da2e Null dereference in DocumentLoader::commitData()
https://bugs.webkit.org/show_bug.cgi?id=221097

Patch by Julian Gonzalez <julian_a_gonzalez@apple.com> on 2021-02-04
Reviewed by Alex Christensen.

Source/WebCore:

Be careful to check the return value of DocumentWriter::begin()
before calling DocumentWriter::setDocumentWasLoadedAsPartOfNavigation().
This work involves exposing MediaDocument.h.

Test: loader/cancel-load-crash.html

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):

Source/WebKit:

As we add another return-early case to commitData(),
WebFrameLoaderClient::committedLoad() has to allow for
the absence of a Document.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::committedLoad):

LayoutTests:

Add a test that catches the null dereference
in DocumentLoader::commitData().

* loader/cancel-load-crash-expected.txt: Added.
* loader/cancel-load-crash.html: Added.

Canonical link: https://commits.webkit.org/233721@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-05 00:17:06 +00:00
..
navigation-policy/should-open-external-urls
resources
stateobjects
cancel-load-crash-expected.txt
cancel-load-crash.html
change-src-during-iframe-load-crash-expected.txt
change-src-during-iframe-load-crash.html
go-back-cached-main-resource-expected.txt
go-back-cached-main-resource.html
go-back-to-different-window-size-expected.txt
go-back-to-different-window-size.html
image-loader-adoptNode-assert-expected.txt
image-loader-adoptNode-assert.html
load-defer-expected.txt
load-defer-resume-crash-expected.txt
load-defer-resume-crash.html
load-defer.html
meta-refresh-disabled-expected.txt
meta-refresh-disabled.html
navigation-while-deferring-loads-expected.txt
navigation-while-deferring-loads.html
reload-subresource-when-type-changes-expected.txt
reload-subresource-when-type-changes.html