Skip to content

Commit

Permalink
update tests/uaf
Browse files Browse the repository at this point in the history
  • Loading branch information
hxuhack committed Dec 30, 2024
1 parent 2ebcd6c commit ddeb801
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/support/uaf/df_min/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "safedrop01"
name = "df_main"
version = "0.1.0"
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion tests/support/uaf/uaf_drop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "uaf_00"
name = "uaf_drop"
version = "0.1.0"
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion tests/support/uaf/uaf_drop_in_palce/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "uaf_00"
name = "uaf_drop_in_place"
version = "0.1.0"
edition = "2021"

Expand Down
8 changes: 0 additions & 8 deletions tests/support/uaf/uaf_drop_in_palce/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
#![feature(fn_traits)]
use std::ptr::drop_in_place;
// ptr::drop_in_place
fn main() {
let mut x = Box::from(0);
let ptr = &mut x as *mut Box<i32>;
drop(x);
unsafe {
drop_in_place(ptr);
}
let numbers = vec![10, 20, 30, 40, 50];
let mut iter = numbers.iter();
println!("{:?}", iter.next());

let mut call_count = 0;
let mut c = || { call_count += 1; };
c.call_mut(());
}
2 changes: 1 addition & 1 deletion tests/support/uaf/uaf_lifetime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "uaf_00"
name = "uaf_lifetime"
version = "0.1.0"
edition = "2021"

Expand Down

0 comments on commit ddeb801

Please sign in to comment.