-
Notifications
You must be signed in to change notification settings - Fork 35
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 RingBuffer::extend_from_within_unchecked
unsoundness
#76
Fix RingBuffer::extend_from_within_unchecked
unsoundness
#76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for my workflow with this patch.
I don't know the code of this crate, so I cannot really help with a proper review.
But thanks for taking care :D
…d_from_within_unchecked
3614c90
to
4d30b3c
Compare
Thanks so much for fixing this! The text comments do add a lot of clarification. I find the diagrams a bit hard to read especially when they get to four lines of ^ markers. Maybe something like this would be better?
|
What if we had something like this? To me it looks lighter on the eye.
|
Yes! I think that's perfect |
4d30b3c
to
d2521ec
Compare
d2521ec
to
6d5573b
Compare
I think this is ready. I've tried adding Address Sanitizer and Memory Sanitizer to CI but they fail at linking:
|
Thanks again for the quick action! |
This fixes the unsoundness reported in #75 by correcting the
src
length math. Also adds safety and general comments, making it much easier to understand the logic.The first commit fixes the vulnerability while the other commits cleanup the implementation and add two unrelated debug assertions.
Fixes #75