Skip to content

Fix Address this pointer outliving its stack buffer - #2499

Merged
Headline merged 1 commit into
alliedmodders:k/sourcehook_alternativefrom
Mikusch:int64-this-ptr
Jul 4, 2026
Merged

Headline merged 1 commit into
alliedmodders:k/sourcehook_alternativefrom
Mikusch:int64-this-ptr

Conversation

@Mikusch

@Mikusch Mikusch commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

ThisPointer_Address hooks currently hand the callback a null address on 64-bit.
The this pointer is pushed with PushArray((cell_t*)&sm_address, 2), but PushArray only records the pointer and the VM copies the data when the callback actually runs. sm_address is scoped to the inner if, so it's already dead by the time Execute() copies from it.

@Headline
Headline merged commit 6dd44c5 into alliedmodders:k/sourcehook_alternative Jul 4, 2026
@Mikusch
Mikusch deleted the int64-this-ptr branch July 6, 2026 11:26
Kenzzer pushed a commit that referenced this pull request Aug 3, 2026
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.

2 participants