Skip to content

[Vengeance] Fix pick_up_fragment use-after-free crash#11184

Open
taherbert wants to merge 1 commit intosimulationcraft:midnightfrom
taherbert:fix/dh-pick-up-fragment-uaf
Open

[Vengeance] Fix pick_up_fragment use-after-free crash#11184
taherbert wants to merge 1 commit intosimulationcraft:midnightfrom
taherbert:fix/dh-pick-up-fragment-uaf

Conversation

@taherbert
Copy link
Contributor

@taherbert taherbert commented Mar 14, 2026

pick_up_event_t stored a raw pointer to the fragment selected when the action fired. For Vengeance, fragments spawn ~10.6 yards away with a 4-yard pickup radius, so there's a real movement delay before the event resolves. If a spender like Spirit Bomb or Soul Cleave consumes that fragment during the delay, the pointer goes stale and the event dereferences freed memory.

Havoc doesn't hit this because fragments spawn at ~4.6 yards with an 8-yard pickup radius, so movement time is zero and the event fires instantly.

The fix stores the fragment type instead of a raw pointer. When the event fires, it re-selects an active fragment of that type. If the original fragment was consumed, it picks up another one; if none are left, it's a no-op.

@taherbert taherbert changed the title [DH] Fix pick_up_fragment use-after-free crash [Vengeance] Fix pick_up_fragment use-after-free crash Mar 14, 2026
@taherbert taherbert force-pushed the fix/dh-pick-up-fragment-uaf branch from 50ff7d3 to 9cd2643 Compare March 14, 2026 17:32
pick_up_event_t stored a raw pointer to the selected soul_fragment_t.
If another ability consumed and deleted that fragment during the
movement delay, the event would dereference freed memory.

Only surfaces on Vengeance because fragments spawn at ~10.6 yards
(vs Havoc's ~4.6), giving a non-zero movement time where spenders
can consume the fragment before the event fires.

Fix: store the fragment type instead of a raw pointer and re-select
an active fragment when the event fires. Also remove the vestigial
consume_soul_greater null guard which was always true.
@taherbert taherbert force-pushed the fix/dh-pick-up-fragment-uaf branch from 9cd2643 to c112ca6 Compare March 14, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant