Skip to content

Fix cpp type transmutation#2

Merged
willvale merged 3 commits into
workingfrom
fix-cpp-type-transmutation
Jun 30, 2026
Merged

Fix cpp type transmutation#2
willvale merged 3 commits into
workingfrom
fix-cpp-type-transmutation

Conversation

@willvale

Copy link
Copy Markdown
Owner

No description provided.

willvale added 3 commits June 29, 2026 23:06
Storing non-POD types in char buffers is unsafe.

* Ensure alignments are compatible with desired type.
* Ensure raw data is copied with memcpy

Otherwise, the list entries are created raw and placement-constructed as one type, which is changed when they're copied by the copy constructor of T (different type). For POD data this wouldn't matter, but here it changes the vtable pointer and indirectly causes an OOB write.
@willvale willvale merged commit d8a4dd4 into working Jun 30, 2026
4 of 8 checks passed
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