Crash loading local file with WebPageProxy::loadAlternateHTMLString
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Feb 2015 17:11:27 +0000 (17:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Feb 2015 17:11:27 +0000 (17:11 +0000)
commit5fe12803c4768bd1da2d22dfedb1a99fd4f1bcb5
treee32bb9ad81e56606476aa5846681410bf8f3dd05
parent21b41604aad9a4c6246bfa4e9755e4ad9f0993b9
Crash loading local file with WebPageProxy::loadAlternateHTMLString
https://bugs.webkit.org/show_bug.cgi?id=141867

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2015-02-24
Reviewed by Anders Carlsson.

Source/WebKit2:

WebPageProxy::loadAlternateHTMLString needs to assume read access to unreachableURL as well
as baseURL, because unreachableURL will get added to the back/forward list, causing us to
crash later on when we notice the unexpected URL received in checkURLReceivedFromWebProcess.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadAlternateHTMLString):

Tools:

* TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp:
(TestWebKitAPI::loadAlternateHTMLString): Split most of this test into a function so it can
be shared with the new test.
(TestWebKitAPI::TEST): Add a cross-platform test for this crash.
* TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp: Add a GTK+ test for this crash.
(testLoadAlternateHTMLForLocalPage):
(beforeAll):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp