Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero-out msgpack_buffer_chunk_t after allocation #342

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

casperisfine
Copy link

Fix: #341

These struct contain a VALUE reference so if we don't zero it out, it could be pointing at a T_NONE or some other old object slot.

Especially since we can re-use existing chunks.

cc @peterzhu2118 @pavel-workato

Fix: msgpack#341

These struct contain a VALUE reference so if we don't zero
it out, it could be pointing at a T_NONE or some other old
object slot.

Especially since we can re-use existing chunks.
@byroot byroot merged commit 96b21a4 into msgpack:master Jun 29, 2023
casperisfine pushed a commit to Shopify/msgpack-ruby that referenced this pull request Jul 12, 2023
Fix: msgpack#342

Reseting the memory in _msgpack_buffer_alloc_new_chunk was pointless
because the previous `tail` is immediately copied into it, and it's
the `tail` that is then used by the caller. So it's the `tail` we
should zero-out.
casperisfine pushed a commit to Shopify/msgpack-ruby that referenced this pull request Jul 12, 2023
Fix: msgpack#342

Reseting the memory in _msgpack_buffer_alloc_new_chunk was pointless
because the previous `tail` is immediately copied into it, and it's
the `tail` that is then used by the caller. So it's the `tail` we
should zero-out.
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.

Attempt to GC mark already marked object
3 participants