[webkit-changes] [WebKit/WebKit] 5dd594: Crash in PDFDocument::sendPDFArrayBuffer

Michael Catanzaro noreply at github.com
Tue May 16 07:31:51 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5dd594fd96bb7a5b61e7af042ffe6036fc206a73
      https://github.com/WebKit/WebKit/commit/5dd594fd96bb7a5b61e7af042ffe6036fc206a73
  Author: Michael Catanzaro <mcatanzaro at redhat.com>
  Date:   2023-05-16 (Tue, 16 May 2023)

  Changed paths:
    M Source/WebCore/html/PDFDocument.cpp

  Log Message:
  -----------
  Crash in PDFDocument::sendPDFArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=256470

Reviewed by Tim Nguyen.

When page loading is stopped, PDFDocument::finishedParsing will be
called (which makes sense, because the parsing is finished, even if not
completed). Here sendPDFArrayBuffer will be called if the content script
has been loaded, even if there is no main resource data yet. We need
guards to ensure we don't dereference nullptr when there is no main
resource data.

Additionally, I've added an extra guard to ensure the document loader is
not nullptr. Maybe that's not possible here -- not sure -- but since the
function returns a pointer and not a reference it seems safer to check.

* Source/WebCore/html/PDFDocument.cpp:
(WebCore::PDFDocument::sendPDFArrayBuffer):

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




More information about the webkit-changes mailing list