Skip to content

Commit

Permalink
Cherry-pick 3194a24. rdar://99740304
Browse files Browse the repository at this point in the history
    CrashTracer: com.apple.WebKit.WebContent at WebKit: WebKit::WebPage::drawPagesToPDFImpl
    https://bugs.webkit.org/show_bug.cgi?id=269881
    rdar://99740304

    Reviewed by Wenson Hsieh.

    Crash reports have been showing null derefs of `m_printContext` under
    `drawPagesToPDFImpl`. However, it is unclear exactly what results in this
    scenario, and a user reports have not been found.

    Fix by adding a null check.

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

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

Identifier: 272448.622@safari-7618-branch
  • Loading branch information
pxlcoder authored and MyahCobbs committed Feb 24, 2024
1 parent 465cb87 commit 00b5ed7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Source/WebKit/WebProcess/WebPage/WebPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6248,6 +6248,9 @@ void WebPage::drawPagesToPDFImpl(FrameIdentifier frameID, const PrintInfo& print
} else
#endif
{
if (!m_printContext)
return;

size_t pageCount = m_printContext->pageCount();
for (uint32_t page = first; page < first + count; ++page) {
if (page >= pageCount)
Expand Down

0 comments on commit 00b5ed7

Please sign in to comment.