-
Notifications
You must be signed in to change notification settings - Fork 0
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
swap_index can write out bounds and return uninitialized memory #1
Comments
Heads up: this issue has been included in the RustSec advisory database. It will be surfaced by tools such as cargo-audit or cargo-deny from now on. Once a fix is released to crates.io, please open a pull request to update the advisory with the patched version, or file an issue on the advisory database repository. |
Thank you for the heads up! I submitted a pull request to fix this problem. |
looks like the pull request made it in. thanks for the help |
Hi there, we (Rust group @sslab-gatech) are scanning crates on crates.io for potential soundness bugs. We noticed that in
swap_index
, the length returned by the iterator is used to set the length of the vector:reorder/src/lib.rs
Lines 46 to 56 in 59ad9be
However, as noted in the documentation for
ExactSizeIterator
'slen()
function:and then
size_hint
's documentation says:Here's an example of some code that will use uninitialized memory through this method:
The text was updated successfully, but these errors were encountered: