Title: [238982] releases/WebKitGTK/webkit-2.22
Revision
238982
Author
[email protected]
Date
2018-12-07 16:25:25 -0800 (Fri, 07 Dec 2018)

Log Message

Merge r238562 - Disallow loading webarchives as iframes
https://bugs.webkit.org/show_bug.cgi?id=191728
<rdar://problem/45524528>

Reviewed by Youenn Fablet.

Source/WebCore:

Disallow loading webarchives as iframes. We don't allow loading remote webarchives.
Now, this policy is hardened to disallow loading webarchives as iframes for local
documents as well.

To allow old tests still be able to run, a flag is added to always allow loading local
webarchives in document. The flag can be set via window.internals.

Tests: webarchive/loading/test-loading-archive-subresource.html
       webarchive/loading/test-loading-top-archive.html

* dom/Document.h:
(WebCore::Document::setAlwaysAllowLocalWebarchive):
(WebCore::Document::alwaysAllowLocalWebarchive):
* loader/DocumentLoader.cpp:
(WebCore::disallowWebArchive):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::isRemoteWebArchive): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::setAlwaysAllowLocalWebarchive const):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::unableToImplementPolicy):
Add a check to prevent null pointer dereference.

LayoutTests:

* platform/mac-wk1/webarchive/loading/test-loading-archive-subresource-expected.txt: Added.
* platform/mac/fast/loader/webarchive-encoding-respected.html:
* webarchive/loading/cache-expired-subresource.html:
* webarchive/loading/mainresource-null-mimetype-crash.html:
* webarchive/loading/missing-data.html:
* webarchive/loading/resources/test-loading-archive-main.webarchive: Copied from LayoutTests/webarchive/loading/test-loading-archive.html.
* webarchive/loading/test-loading-archive-subresource-expected.txt: Added.
* webarchive/loading/test-loading-archive-subresource-null-mimetype.html:
* webarchive/loading/test-loading-archive-subresource.html: Copied from LayoutTests/webarchive/loading/test-loading-archive.html.
* webarchive/loading/test-loading-archive.html:
* webarchive/loading/test-loading-top-archive-expected.txt: Added.
* webarchive/loading/test-loading-top-archive.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog	2018-12-08 00:25:25 UTC (rev 238982)
@@ -1,3 +1,24 @@
+2018-11-16  Jiewen Tan  <[email protected]>
+
+        Disallow loading webarchives as iframes
+        https://bugs.webkit.org/show_bug.cgi?id=191728
+        <rdar://problem/45524528>
+
+        Reviewed by Youenn Fablet.
+
+        * platform/mac-wk1/webarchive/loading/test-loading-archive-subresource-expected.txt: Added.
+        * platform/mac/fast/loader/webarchive-encoding-respected.html:
+        * webarchive/loading/cache-expired-subresource.html:
+        * webarchive/loading/mainresource-null-mimetype-crash.html:
+        * webarchive/loading/missing-data.html:
+        * webarchive/loading/resources/test-loading-archive-main.webarchive: Copied from LayoutTests/webarchive/loading/test-loading-archive.html.
+        * webarchive/loading/test-loading-archive-subresource-expected.txt: Added.
+        * webarchive/loading/test-loading-archive-subresource-null-mimetype.html:
+        * webarchive/loading/test-loading-archive-subresource.html: Copied from LayoutTests/webarchive/loading/test-loading-archive.html.
+        * webarchive/loading/test-loading-archive.html:
+        * webarchive/loading/test-loading-top-archive-expected.txt: Added.
+        * webarchive/loading/test-loading-top-archive.html: Added.
+
 2018-11-30  Jiewen Tan  <[email protected]>
 
         Don't report resource timing to parent frame for history items

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/platform/mac/fast/loader/webarchive-encoding-respected.html (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/platform/mac/fast/loader/webarchive-encoding-respected.html	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/platform/mac/fast/loader/webarchive-encoding-respected.html	2018-12-08 00:25:25 UTC (rev 238982)
@@ -3,6 +3,8 @@
 	testRunner.dumpAsText();
 	testRunner.dumpChildFramesAsText();
 }
+if (window.internals)
+    internals.setAlwaysAllowLocalWebarchive();
 </script>
 The webarchive in this iframe is utf-8 encoded and will only display properly if the webarchive's encoding is respected.<br>
 <iframe src=""

Added: releases/WebKitGTK/webkit-2.22/LayoutTests/platform/mac-wk1/webarchive/loading/test-loading-archive-subresource-expected.txt (0 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/platform/mac-wk1/webarchive/loading/test-loading-archive-subresource-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/platform/mac-wk1/webarchive/loading/test-loading-archive-subresource-expected.txt	2018-12-08 00:25:25 UTC (rev 238982)
@@ -0,0 +1,8 @@
+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+frame "<!--frame1-->" - didStartProvisionalLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+frame "<!--frame1-->" - didFailProvisionalLoadWithError
+main frame - didFinishLoadForFrame
+ This test assumes the webarchive is not loaded.

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/cache-expired-subresource.html (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/cache-expired-subresource.html	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/cache-expired-subresource.html	2018-12-08 00:25:25 UTC (rev 238982)
@@ -4,6 +4,8 @@
         testRunner.dumpResourceLoadCallbacks();
         testRunner.waitUntilDone();
     }
+    if (window.internals)
+        internals.setAlwaysAllowLocalWebarchive();
     
     function frameLoaded() {
         if (window.testRunner)

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/mainresource-null-mimetype-crash.html (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/mainresource-null-mimetype-crash.html	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/mainresource-null-mimetype-crash.html	2018-12-08 00:25:25 UTC (rev 238982)
@@ -4,6 +4,8 @@
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
     }
+    if (window.internals)
+        internals.setAlwaysAllowLocalWebarchive();
     _onload_ = function() {
         frame = document.createElement("iframe");
         frame.src = ""

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/missing-data.html (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/missing-data.html	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/missing-data.html	2018-12-08 00:25:25 UTC (rev 238982)
@@ -3,7 +3,8 @@
         testRunner.waitUntilDone();
         testRunner.dumpAsText();
     }
-
+    if (window.internals)
+        internals.setAlwaysAllowLocalWebarchive();
     _onload_ = function() {
         frame = document.createElement("iframe");
         frame.src = ""

Added: releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/resources/top.webarchive (0 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/resources/top.webarchive	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/resources/top.webarchive	2018-12-08 00:25:25 UTC (rev 238982)
@@ -0,0 +1,11 @@
+bplist00\xD1_WebMainResource\xD5	
+^WebResourceURL_WebResourceFrameName_WebResourceData_WebResourceMIMEType_WebResourceTextEncodingName_Wfile:///Users/jwtan/Documents/Source/OpenSource/LayoutTests/webarchive/loading/top.htmlPO\xAD<html><head><script>
+    _onload_ = function() {
+        if (window.testRunner)
+            testRunner.notifyDone();
+    }
+</script>
+</head><body>hello, world.
+
+</body></html>Ytext/htmlUUTF-8��������(��7��N��`��v��\x94��\xEE��\xEF\x9F\xA9��������������������������+����������������������������\xAF
\ No newline at end of file

Added: releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive-subresource-expected.txt (0 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive-subresource-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive-subresource-expected.txt	2018-12-08 00:25:25 UTC (rev 238982)
@@ -0,0 +1,8 @@
+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+frame "<!--frame1-->" - didStartProvisionalLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+frame "<!--frame1-->" - didFailProvisionalLoadWithError
+main frame - didFinishLoadForFrame
+ This test assumes the webarchive is not loaded.

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive-subresource-null-mimetype.html (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive-subresource-null-mimetype.html	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive-subresource-null-mimetype.html	2018-12-08 00:25:25 UTC (rev 238982)
@@ -5,7 +5,8 @@
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
     }
-    
+    if (window.internals)
+        internals.setAlwaysAllowLocalWebarchive();
     function frameLoaded() {
         if (window.testRunner)
             testRunner.notifyDone();

Copied: releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive-subresource.html (from rev 238981, releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive.html) (0 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive-subresource.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive-subresource.html	2018-12-08 00:25:25 UTC (rev 238982)
@@ -0,0 +1,18 @@
+<html>
+<script>
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+        testRunner.waitUntilDone();
+    }
+
+    function frameLoaded() {
+        if (window.testRunner)
+            testRunner.notifyDone();
+    }
+    setTimeout(frameLoaded, 10);
+</script>
+<body>
+    <iframe _onload_="frameLoaded();" src=""
+    This test assumes the webarchive is not loaded.
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive.html (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive.html	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-archive.html	2018-12-08 00:25:25 UTC (rev 238982)
@@ -5,7 +5,8 @@
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
     }
-    
+    if (window.internals)
+        internals.setAlwaysAllowLocalWebarchive();
     function frameLoaded() {
         if (window.testRunner)
             testRunner.notifyDone();

Added: releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-top-archive-expected.txt (0 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-top-archive-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-top-archive-expected.txt	2018-12-08 00:25:25 UTC (rev 238982)
@@ -0,0 +1,12 @@
+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - willPerformClientRedirectToURL: resources/top.webarchive
+main frame - didFinishDocumentLoadForFrame
+main frame - didFinishLoadForFrame
+main frame - didStartProvisionalLoadForFrame
+main frame - didCancelClientRedirectForFrame
+main frame - didCommitLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+hello, world.

Added: releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-top-archive.html (0 => 238982)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-top-archive.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/webarchive/loading/test-loading-top-archive.html	2018-12-08 00:25:25 UTC (rev 238982)
@@ -0,0 +1,9 @@
+<html>
+<script>
+    if (window.testRunner) {
+        testRunner.waitUntilDone();
+        testRunner.dumpAsText();
+    }
+    window.location="resources/top.webarchive";
+</script>
+</html>

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-12-08 00:25:25 UTC (rev 238982)
@@ -1,3 +1,33 @@
+2018-11-16  Jiewen Tan  <[email protected]>
+
+        Disallow loading webarchives as iframes
+        https://bugs.webkit.org/show_bug.cgi?id=191728
+        <rdar://problem/45524528>
+
+        Reviewed by Youenn Fablet.
+
+        Disallow loading webarchives as iframes. We don't allow loading remote webarchives.
+        Now, this policy is hardened to disallow loading webarchives as iframes for local
+        documents as well.
+
+        To allow old tests still be able to run, a flag is added to always allow loading local
+        webarchives in document. The flag can be set via window.internals.
+
+        Tests: webarchive/loading/test-loading-archive-subresource.html
+               webarchive/loading/test-loading-top-archive.html
+
+        * dom/Document.h:
+        (WebCore::Document::setAlwaysAllowLocalWebarchive):
+        (WebCore::Document::alwaysAllowLocalWebarchive):
+        * loader/DocumentLoader.cpp:
+        (WebCore::disallowWebArchive):
+        (WebCore::DocumentLoader::continueAfterContentPolicy):
+        (WebCore::isRemoteWebArchive): Deleted.
+        * testing/Internals.cpp:
+        (WebCore::Internals::setAlwaysAllowLocalWebarchive const):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2018-11-30  Jiewen Tan  <[email protected]>
 
         Don't report resource timing to parent frame for history items

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/dom/Document.h (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/dom/Document.h	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/dom/Document.h	2018-12-08 00:25:25 UTC (rev 238982)
@@ -1483,6 +1483,10 @@
     void setAsRunningUserScripts() { m_isRunningUserScripts = true; }
     bool isRunningUserScripts() const { return m_isRunningUserScripts; }
 
+    // Used in webarchive loading tests.
+    void setAlwaysAllowLocalWebarchive() { m_alwaysAllowLocalWebarchive = true; }
+    bool alwaysAllowLocalWebarchive() const { return m_alwaysAllowLocalWebarchive; }
+
 protected:
     enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 };
     Document(Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned constructionFlags = 0);
@@ -2003,6 +2007,8 @@
     std::unique_ptr<UserGestureIndicator> m_temporaryUserGesture;
 
     bool m_isRunningUserScripts { false };
+
+    bool m_alwaysAllowLocalWebarchive { false };
 };
 
 Element* eventTargetElementForDocument(Document*);

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/DocumentLoader.cpp (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/DocumentLoader.cpp	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/DocumentLoader.cpp	2018-12-08 00:25:25 UTC (rev 238982)
@@ -841,7 +841,9 @@
     });
 }
 
-static bool isRemoteWebArchive(const DocumentLoader& documentLoader)
+// Prevent web archives from loading if it is remote or it is not the main frame because they
+// can claim to be from any domain and thus avoid cross-domain security checks (4120255, 45524528).
+bool DocumentLoader::disallowWebArchive() const
 {
     using MIMETypeHashSet = HashSet<String, ASCIICaseInsensitiveHash>;
     static NeverDestroyed<MIMETypeHashSet> webArchiveMIMETypes {
@@ -855,17 +857,28 @@
         }
     };
 
-    const ResourceResponse& response = documentLoader.response();
-    String mimeType = response.mimeType();
+    String mimeType = m_response.mimeType();
     if (mimeType.isNull() || !webArchiveMIMETypes.get().contains(mimeType))
         return false;
 
 #if USE(QUICK_LOOK)
-    if (isQuickLookPreviewURL(response.url()))
+    if (isQuickLookPreviewURL(m_response.url()))
         return false;
 #endif
 
-    return !documentLoader.substituteData().isValid() && !SchemeRegistry::shouldTreatURLSchemeAsLocal(documentLoader.request().url().protocol().toStringWithoutCopying());
+    if (m_substituteData.isValid())
+        return false;
+
+    if (!SchemeRegistry::shouldTreatURLSchemeAsLocal(m_request.url().protocol().toStringWithoutCopying()))
+        return true;
+
+    if (!frame() || frame()->isMainFrame())
+        return false;
+
+    // On purpose of maintaining existing tests.
+    if (!frame()->document() || frame()->document()->topDocument().alwaysAllowLocalWebarchive())
+        return false;
+    return true;
 }
 
 void DocumentLoader::continueAfterContentPolicy(PolicyAction policy)
@@ -877,8 +890,7 @@
 
     switch (policy) {
     case PolicyAction::Use: {
-        // Prevent remote web archives from loading because they can claim to be from any domain and thus avoid cross-domain security checks (4120255).
-        if (!frameLoader()->client().canShowMIMEType(m_response.mimeType()) || isRemoteWebArchive(*this)) {
+        if (!frameLoader()->client().canShowMIMEType(m_response.mimeType()) || disallowWebArchive()) {
             frameLoader()->policyChecker().cannotShowMIMEType(m_response);
             // Check reachedTerminalState since the load may have already been canceled inside of _handleUnimplementablePolicyWithErrorCode::.
             stopLoadingForPolicyChange();

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/DocumentLoader.h (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/DocumentLoader.h	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/DocumentLoader.h	2018-12-08 00:25:25 UTC (rev 238982)
@@ -414,6 +414,8 @@
     WEBCORE_EXPORT void sendCSPViolationReport(URL&&, Ref<FormData>&&) final;
     WEBCORE_EXPORT void enqueueSecurityPolicyViolationEvent(SecurityPolicyViolationEvent::Init&&) final;
 
+    bool disallowWebArchive() const;
+
     Ref<CachedResourceLoader> m_cachedResourceLoader;
 
     CachedResourceHandle<CachedRawResource> m_mainResource;

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.cpp (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.cpp	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.cpp	2018-12-08 00:25:25 UTC (rev 238982)
@@ -4693,4 +4693,12 @@
     ResourceLoadObserver::shared().notifyObserver();
 }
 
+void Internals::setAlwaysAllowLocalWebarchive() const
+{
+    auto* document = contextDocument();
+    if (!document)
+        return;
+    document->setAlwaysAllowLocalWebarchive();
+}
+
 } // namespace WebCore

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.h (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.h	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.h	2018-12-08 00:25:25 UTC (rev 238982)
@@ -731,6 +731,8 @@
 
     void notifyResourceLoadObserver();
 
+    void setAlwaysAllowLocalWebarchive() const;
+
 private:
     explicit Internals(Document&);
     Document* contextDocument() const;

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.idl (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.idl	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.idl	2018-12-08 00:25:25 UTC (rev 238982)
@@ -666,4 +666,6 @@
     unsigned long pluginCount();
 
     void notifyResourceLoadObserver();
+
+    void setAlwaysAllowLocalWebarchive();
 };

Modified: releases/WebKitGTK/webkit-2.22/Source/WebKit/ChangeLog (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/Source/WebKit/ChangeLog	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/Source/WebKit/ChangeLog	2018-12-08 00:25:25 UTC (rev 238982)
@@ -1,3 +1,15 @@
+2018-11-16  Jiewen Tan  <[email protected]>
+
+        Disallow loading webarchives as iframes
+        https://bugs.webkit.org/show_bug.cgi?id=191728
+        <rdar://problem/45524528>
+
+        Reviewed by Youenn Fablet.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::unableToImplementPolicy):
+        Add a check to prevent null pointer dereference.
+
 2018-12-03  Darin Adler  <[email protected]>
 
         Alignment padding needs to be zeroed out in IPC::Encoder

Modified: releases/WebKitGTK/webkit-2.22/Source/WebKit/UIProcess/WebPageProxy.cpp (238981 => 238982)


--- releases/WebKitGTK/webkit-2.22/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-12-08 00:25:15 UTC (rev 238981)
+++ releases/WebKitGTK/webkit-2.22/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-12-08 00:25:25 UTC (rev 238982)
@@ -4165,6 +4165,8 @@
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
 
+    if (!m_policyClient)
+        return;
     m_policyClient->unableToImplementPolicy(*this, *frame, error, m_process->transformHandlesToObjects(userData.object()).get());
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to