Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 20beac1f6ec3a8dae04a9e38e4af992ee8c1e134
      
https://github.com/WebKit/WebKit/commit/20beac1f6ec3a8dae04a9e38e4af992ee8c1e134
  Author: Ryosuke Niwa <[email protected]>
  Date:   2026-05-29 (Fri, 29 May 2026)

  Changed paths:
    A 
LayoutTests/fast/shadow-dom/named-slot-assignment-resolve-after-mutation-crash-expected.txt
    A 
LayoutTests/fast/shadow-dom/named-slot-assignment-resolve-after-mutation-crash.html
    M Source/WebCore/dom/SlotAssignment.cpp

  Log Message:
  -----------
  Use-after-free in NamedSlotAssignment::resolveSlotsAfterSlotMutation
https://bugs.webkit.org/show_bug.cgi?id=312247
rdar://174493428

Reviewed by Chris Dumez and Anne van Kesteren.

The bug was caused by hasAssignedNodes updating m_slots as a part of resolving 
slot assignments while
we're iterating over m_slots in 
NamedSlotAssignment::resolveSlotsAfterSlotMutation. Fixed the bug by
avoiding updating slot assignments upfront and simply checking 
slot->assignedNodes.isEmpty() instead.

Test: fast/shadow-dom/named-slot-assignment-resolve-after-mutation-crash.html

* 
LayoutTests/fast/shadow-dom/named-slot-assignment-resolve-after-mutation-crash-expected.txt:
 Added.
* 
LayoutTests/fast/shadow-dom/named-slot-assignment-resolve-after-mutation-crash.html:
 Added.
* Source/WebCore/dom/SlotAssignment.cpp:
(WebCore::NamedSlotAssignment::resolveSlotsAfterSlotMutation):

Originally-landed-as: 305413.669@safari-7624-branch (cbcbdcfa297d). 
rdar://176058656
Canonical link: https://commits.webkit.org/314129@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to