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