⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285179 in webkit


Ignore:
Timestamp:
Nov 2, 2021, 1:44:33 PM (5 years ago)
Author:
Chris Dumez
Message:

Crash under WebPage::sendCOEPCORPViolation()
​https://bugs.webkit.org/show_bug.cgi?id=232631
<rdar://84919898>

Reviewed by Alex Christensen.

Add missing null checks for the frame after calling WebProcess::singleton().webFrame(frameID).

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::sendCOEPPolicyInheritenceViolation):
(WebKit::WebPage::sendCOEPCORPViolation):
(WebKit::WebPage::sendViolationReportWhenNavigatingToCOOPResponse):
(WebKit::WebPage::sendViolationReportWhenNavigatingAwayFromCOOPResponse):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r285177 r285179  
     12021-11-02  Chris Dumez  <cdumez@apple.com>
     2
     3        Crash under WebPage::sendCOEPCORPViolation()
     4        https://bugs.webkit.org/show_bug.cgi?id=232631
     5        <rdar://84919898>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Add missing null checks for the frame after calling `WebProcess::singleton().webFrame(frameID)`.
     10
     11        * WebProcess/WebPage/WebPage.cpp:
     12        (WebKit::WebPage::sendCOEPPolicyInheritenceViolation):
     13        (WebKit::WebPage::sendCOEPCORPViolation):
     14        (WebKit::WebPage::sendViolationReportWhenNavigatingToCOOPResponse):
     15        (WebKit::WebPage::sendViolationReportWhenNavigatingAwayFromCOOPResponse):
     16
    1172021-11-02  Sihui Liu  <sihui_liu@apple.com>
    218
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r285089 r285179  
    43204320void WebPage::sendCOEPPolicyInheritenceViolation(FrameIdentifier frameID, const SecurityOriginData& embedderOrigin, const String& endpoint, COEPDisposition disposition, const String& type, const URL& blockedURL)
    43214321{
    4322     if (auto* frame = WebProcess::singleton().webFrame(frameID); frame->coreFrame())
     4322    if (auto* frame = WebProcess::singleton().webFrame(frameID); frame && frame->coreFrame())
    43234323        WebCore::sendCOEPPolicyInheritenceViolation(*frame->coreFrame(), embedderOrigin, endpoint, disposition, type, blockedURL);
    43244324}
    … …  
    43264326void WebPage::sendCOEPCORPViolation(FrameIdentifier frameID, const SecurityOriginData& embedderOrigin, const String& endpoint, COEPDisposition disposition, FetchOptions::Destination destination, const URL& blockedURL)
    43274327{
    4328     if (auto* frame = WebProcess::singleton().webFrame(frameID); frame->coreFrame())
     4328    if (auto* frame = WebProcess::singleton().webFrame(frameID); frame && frame->coreFrame())
    43294329        WebCore::sendCOEPCORPViolation(*frame->coreFrame(), embedderOrigin, endpoint, disposition, destination, blockedURL);
    43304330}
    … …  
    43394339        return;
    43404340
    4341     if (auto* frame = WebProcess::singleton().webFrame(frameID); frame->coreFrame())
     4341    if (auto* frame = WebProcess::singleton().webFrame(frameID); frame && frame->coreFrame())
    43424342        WebCore::sendViolationReportWhenNavigatingToCOOPResponse(*frame->coreFrame(), coop, disposition, coopURL, previousResponseURL, coopOrigin.securityOrigin(), previousResponseOrigin.securityOrigin(), referrer, userAgent);
    43434343}
    … …  
    43494349        return;
    43504350
    4351     if (auto* frame = WebProcess::singleton().webFrame(frameID); frame->coreFrame())
     4351    if (auto* frame = WebProcess::singleton().webFrame(frameID); frame && frame->coreFrame())
    43524352        WebCore::sendViolationReportWhenNavigatingAwayFromCOOPResponse(*frame->coreFrame(), coop, disposition, coopURL, nextResponseURL, coopOrigin.securityOrigin(), nextResponseOrigin.securityOrigin(), isCOOPResponseNavigationSource, userAgent);
    43534353}
Note: See TracChangeset for help on using the changeset viewer.