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

fix: UAF in SmallBox::into_inner #28

Merged
merged 3 commits into from
Sep 23, 2024
Merged

Conversation

GnomedDev
Copy link
Contributor

Fixes #25. This also preemptively fixes other possible UB sites using ManuallyDrop.

ManuallyDrop is safer than mem::forget as it allows you to use the value after forgetting it, which allows guarding against the hidden control flow of unwinding panics.

A RustSec advisory should probably be filed for this, although I can do that if you don't feel comfortable.

@andylokandy andylokandy changed the title Fix UAF in SmallBox::into_inner fix: UAF in SmallBox::into_inner Sep 23, 2024
@andylokandy
Copy link
Owner

Brilliant way! Thank you!

@andylokandy andylokandy merged commit b15e562 into andylokandy:master Sep 23, 2024
8 of 9 checks passed
@GnomedDev GnomedDev deleted the fix-ub branch September 23, 2024 11:56
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.

into_inner double-free
2 participants