-
Notifications
You must be signed in to change notification settings - Fork 40
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
Memory safety problem in insert_many()
#53
Comments
For what it's worth, the way this crate uses |
Hi! Thank you for this report. I am fairly confident that my commit addresses the concerns of an iterator that underestimates its contents. That said, I would appreciate a double check. Please close this issue if you believe my commit is correct, or comment if it requires further work. |
The patch breaks the element ordering: Maybe apply the patch from the upstream smallvec? |
Gah. Figured I'd miss something. Thanks for the patch note. This ought to do it. You know, there's a perfectly good |
|
Default to 32-bit limbs if CARGO_CFG_TARGET_ARCH is not set. This way, we do not rely on the host architecture for the fallback. 32-bit limbs should generally be performant on most architectures.
@Qwaz I believe I've now addressed this, I've also independently tested the logic just to ensure it works with faulty iterators. I'll keep this issue open until the new version with the patch is released. The implementation is essentially identical to servo/rust-smallvec's current implementation, just to avoid any risks with unusual edge-cases. Does this fix look satisfactory? |
Thanks for the fix, it looks good. |
Wonderful, I'll keep this issue open until the newest version is released (and also backport it to maintained branches). So far this has been backported to every branch. Once again, thank you. |
Closed as of v0.4.8, v0.6.8, and v0.7.6. This did not affect the v0.5 branch, since that depends on stack-vector, which has patched it upstream. |
Hello, we recently reported a buffer overflow bug in
SmallVec::insert_many()
servo/rust-smallvec#252.This crate contains a slightly older copy of
insert_many()
that has the same vulnerability.rust-lexical/lexical-core/src/util/sequence.rs
Lines 34 to 46 in 8c75e29
Please update the code when the fix is published.
Thanks!
The text was updated successfully, but these errors were encountered: