[webkit-changes] [WebKit/WebKit] 8e7024: Potential null dereference of cached resources in ...

Chris Dumez noreply at github.com
Mon Jun 12 12:34:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8e7024fba254b60a10ae4232bfc40a9c84ea2cf6
      https://github.com/WebKit/WebKit/commit/8e7024fba254b60a10ae4232bfc40a9c84ea2cf6
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-06-12 (Mon, 12 Jun 2023)

  Changed paths:
    M Source/WebCore/loader/cache/MemoryCache.cpp

  Log Message:
  -----------
  Potential null dereference of cached resources in MemoryCache::pruneDeadResourcesToSize()
https://bugs.webkit.org/show_bug.cgi?id=257968
rdar://110312729

Reviewed by Sihui Liu.

While we were copying the cached resources to a vector before iterating over them,
this vector still contained weak pointers, which would therefore become null as
we're iterating. To address the issue, we now null check these weak ptrs in the
loops, before using them.

* Source/WebCore/loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneDeadResourcesToSize):

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




More information about the webkit-changes mailing list