Changeset 227758 in webkit


Ignore:
Timestamp:
Jan 29, 2018 3:17:13 PM (6 years ago)
Author:
achristensen@apple.com
Message:

Make policy checks more robust against null pointer dereferencing
https://bugs.webkit.org/show_bug.cgi?id=182263
<rdar://problem/34895714>

Reviewed by Tim Horton.

We're still dereferencing null. Check everything.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r227755 r227758  
     12018-01-29  Alex Christensen  <achristensen@webkit.org>
     2
     3        Make policy checks more robust against null pointer dereferencing
     4        https://bugs.webkit.org/show_bug.cgi?id=182263
     5        <rdar://problem/34895714>
     6
     7        Reviewed by Tim Horton.
     8
     9        We're still dereferencing null.  Check everything.
     10
     11        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     12        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
     13
    1142018-01-29  Brent Fulgham  <bfulgham@apple.com>
    215
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r227546 r227758  
    749749    if (!coreFrame)
    750750        return function(PolicyAction::Ignore);
    751     auto navigationID = static_cast<WebDocumentLoader&>(*coreFrame->loader().provisionalDocumentLoader()).navigationID();
     751    auto* policyDocumentLoader = coreFrame->loader().provisionalDocumentLoader();
     752    if (!policyDocumentLoader)
     753        return function(PolicyAction::Ignore);
     754    auto navigationID = static_cast<WebDocumentLoader&>(*policyDocumentLoader).navigationID();
    752755    if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForResponseSync(m_frame->frameID(), SecurityOriginData::fromFrame(coreFrame), navigationID, response, request, canShowMIMEType, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())), Messages::WebPageProxy::DecidePolicyForResponseSync::Reply(receivedPolicyAction, policyAction, downloadID), Seconds::infinity(), IPC::SendSyncOption::InformPlatformProcessWillSuspend)) {
    753756        m_frame->didReceivePolicyDecision(listenerID, PolicyAction::Ignore, 0, { }, { });
Note: See TracChangeset for help on using the changeset viewer.