Skip to content

Commit

Permalink
Cherry-pick c3b754f. rdar://118486861
Browse files Browse the repository at this point in the history
    Crash under WebPage::close()
    https://bugs.webkit.org/show_bug.cgi?id=269373
    rdar://118486861

    Reviewed by Brent Fulgham.

    Add a null check for the LocalFrame given that nothing prevents it
    from being null and we're seeing null dereferences in the wild.

    * Source/WebKit/WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::close):

    Canonical link: https://commits.webkit.org/274641@main

Identifier: 272448.609@safari-7618-branch
  • Loading branch information
cdumez authored and MyahCobbs committed Feb 23, 2024
1 parent 1ae7cde commit 0df832d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/WebKit/WebProcess/WebPage/WebPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,8 @@ void WebPage::close()
#endif

m_printContext = nullptr;
m_mainFrame->coreLocalFrame()->loader().detachFromParent();
if (RefPtr localFrame = m_mainFrame->coreLocalFrame())
localFrame->loader().detachFromParent();

#if ENABLE(SCROLLING_THREAD)
if (m_useAsyncScrolling)
Expand Down

0 comments on commit 0df832d

Please sign in to comment.