-
Notifications
You must be signed in to change notification settings - Fork 2
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
Panic Safety and soundness issue in insert_row #13
Comments
@ammaraskar Awesome, thanks for the bug report. I'll look into fixing these issues. |
@ammaraskar If you have time, please take a look at my commit and assess. I wasn't willing to sacrifice too much speed, so the code remains in an |
Thank you for the quick fixes, they both look good to me! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there, we (Rust group @sslab-gatech) are scanning crates on crates.io for potential soundness bugs. We noticed a panic safety issue in the
TooDee::insert_row
function:toodee/src/toodee.rs
Lines 674 to 683 in 676fe64
During this part, the elements are shifted over which can potentially duplicate them. After this,
for e in iter
is called which can potentially panic. If this occurs, the duplicated elements can be dropped twice leading to a double free, see this example:This outputs:
Secondly, the function reserves space based on the
len()
provided byExactSizeIterator
. However, this trait shouldn't be trusted in unsafe code and can potentially lead to issues such as using undefined memory when it is implemented incorrectly like so:This outputs:
The text was updated successfully, but these errors were encountered: