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
You can also get it to double free just as easily:
use cbox::*;
fn main() {
let p = vec![1, 2, 3].as_mut_ptr();
let semibox: CSemiBox<'static, str> = CSemiBox::new(p as _);
drop(semibox);
println!("Hello World")
}
fn main() {
let mut vec = vec![139,50];
let p = vec.as_mut_ptr();
let cbox: CBox<str> = CBox::new(p as _);
let s: &str = cbox.deref();
println!("Hello World: {:?}", s);
}
Anyhow this is a fun library :)
But it was written 5 years ago... so IMO the bug is in any library that is still maintained/used that uses a library that was last maintained before Rust 1.10 came out
Getting a segmentation fault is as easy as:
This allows to de-reference arbitrary raw pointers.
The text was updated successfully, but these errors were encountered: