Title: [246833] branches/safari-608.1.31.0-branch/Source
Revision
246833
Author
bshaf...@apple.com
Date
2019-06-25 23:53:29 -0700 (Tue, 25 Jun 2019)

Log Message

Cherry-pick r246767. rdar://problem/51535942

    Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
    <rdar://problem/51535942> and https://bugs.webkit.org/show_bug.cgi?id=199123

    Reviewed by Andy Estes.

    Source/WebCore:

    * loader/FrameLoaderStateMachine.h:
    (WebCore::FrameLoaderStateMachine::stateForDebugging const):

    Source/WebKit:

    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
    (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): Properly detect this null DocumentLoader
      and try to learn more about the state of things.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246767 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-608.1.31.0-branch/Source/WebCore/ChangeLog (246832 => 246833)


--- branches/safari-608.1.31.0-branch/Source/WebCore/ChangeLog	2019-06-26 03:56:58 UTC (rev 246832)
+++ branches/safari-608.1.31.0-branch/Source/WebCore/ChangeLog	2019-06-26 06:53:29 UTC (rev 246833)
@@ -1,3 +1,36 @@
+2019-06-25  Babak Shafiei  <bshaf...@apple.com>
+
+        Cherry-pick r246767. rdar://problem/51535942
+
+    Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
+    <rdar://problem/51535942> and https://bugs.webkit.org/show_bug.cgi?id=199123
+    
+    Reviewed by Andy Estes.
+    
+    Source/WebCore:
+    
+    * loader/FrameLoaderStateMachine.h:
+    (WebCore::FrameLoaderStateMachine::stateForDebugging const):
+    
+    Source/WebKit:
+    
+    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+    (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): Properly detect this null DocumentLoader
+      and try to learn more about the state of things.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-06-24  Brady Eidson  <beid...@apple.com>
+
+            Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
+            <rdar://problem/51535942> and https://bugs.webkit.org/show_bug.cgi?id=199123
+
+            Reviewed by Andy Estes.
+
+            * loader/FrameLoaderStateMachine.h:
+            (WebCore::FrameLoaderStateMachine::stateForDebugging const):
+
 2019-06-24  Alan Coon  <alanc...@apple.com>
 
         Revert r246530. rdar://problem/52020968

Modified: branches/safari-608.1.31.0-branch/Source/WebCore/loader/FrameLoaderStateMachine.h (246832 => 246833)


--- branches/safari-608.1.31.0-branch/Source/WebCore/loader/FrameLoaderStateMachine.h	2019-06-26 03:56:58 UTC (rev 246832)
+++ branches/safari-608.1.31.0-branch/Source/WebCore/loader/FrameLoaderStateMachine.h	2019-06-26 06:53:29 UTC (rev 246833)
@@ -57,6 +57,8 @@
     WEBCORE_EXPORT bool firstLayoutDone() const;
     void advanceTo(State);
 
+    State stateForDebugging() const { return m_state; }
+
 private:
     State m_state;
 };

Modified: branches/safari-608.1.31.0-branch/Source/WebKit/ChangeLog (246832 => 246833)


--- branches/safari-608.1.31.0-branch/Source/WebKit/ChangeLog	2019-06-26 03:56:58 UTC (rev 246832)
+++ branches/safari-608.1.31.0-branch/Source/WebKit/ChangeLog	2019-06-26 06:53:29 UTC (rev 246833)
@@ -1,3 +1,37 @@
+2019-06-25  Babak Shafiei  <bshaf...@apple.com>
+
+        Cherry-pick r246767. rdar://problem/51535942
+
+    Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
+    <rdar://problem/51535942> and https://bugs.webkit.org/show_bug.cgi?id=199123
+    
+    Reviewed by Andy Estes.
+    
+    Source/WebCore:
+    
+    * loader/FrameLoaderStateMachine.h:
+    (WebCore::FrameLoaderStateMachine::stateForDebugging const):
+    
+    Source/WebKit:
+    
+    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+    (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): Properly detect this null DocumentLoader
+      and try to learn more about the state of things.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-06-24  Brady Eidson  <beid...@apple.com>
+
+            Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
+            <rdar://problem/51535942> and https://bugs.webkit.org/show_bug.cgi?id=199123
+
+            Reviewed by Andy Estes.
+
+            * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+            (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): Properly detect this null DocumentLoader
+              and try to learn more about the state of things.
+
 2019-06-24  Alan Coon  <alanc...@apple.com>
 
         Revert r246530. rdar://problem/52020968

Modified: branches/safari-608.1.31.0-branch/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (246832 => 246833)


--- branches/safari-608.1.31.0-branch/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2019-06-26 03:56:58 UTC (rev 246832)
+++ branches/safari-608.1.31.0-branch/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2019-06-26 06:53:29 UTC (rev 246833)
@@ -311,16 +311,21 @@
     if (!webPage)
         return;
 
-    WebDocumentLoader& documentLoader = static_cast<WebDocumentLoader&>(*m_frame->coreFrame()->loader().provisionalDocumentLoader());
+    WebDocumentLoader* documentLoader = static_cast<WebDocumentLoader*>(m_frame->coreFrame()->loader().provisionalDocumentLoader());
+    if (!documentLoader) {
+        RELEASE_LOG_FAULT(Loading, "WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad called with no provisional DocumentLoader. FrameState is %i. FrameLoaderStateMachine stateForDebugging - %i", m_frame->coreFrame()->loader().state(), m_frame->coreFrame()->loader().stateMachine().stateForDebugging());
+        return;
+    }
+
     RefPtr<API::Object> userData;
 
-    LOG(Loading, "WebProcess %i - dispatchDidReceiveServerRedirectForProvisionalLoad to request url %s", getCurrentProcessID(), documentLoader.request().url().string().utf8().data());
+    LOG(Loading, "WebProcess %i - dispatchDidReceiveServerRedirectForProvisionalLoad to request url %s", getCurrentProcessID(), documentLoader->request().url().string().utf8().data());
 
     // Notify the bundle client.
     webPage->injectedBundleLoaderClient().didReceiveServerRedirectForProvisionalLoadForFrame(*webPage, *m_frame, userData);
 
     // Notify the UIProcess.
-    webPage->send(Messages::WebPageProxy::DidReceiveServerRedirectForProvisionalLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.request(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+    webPage->send(Messages::WebPageProxy::DidReceiveServerRedirectForProvisionalLoadForFrame(m_frame->frameID(), documentLoader->navigationID(), documentLoader->request(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 }
 
 void WebFrameLoaderClient::dispatchDidChangeProvisionalURL()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to