You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
thread 'main' panicked at 'Iterator panicked', src/main.rs:39:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Dropping 1
Dropping 1
Dropping 2
Secondly, the function reserves space based on the len() provided by ExactSizeIterator. 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:
@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 unsafe block. Note also that insert_col() had similar issues, so I've addressed them too.
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: