From ddeb8017e1329454d478a6a2cabe0bc36447b180 Mon Sep 17 00:00:00 2001 From: aisr Date: Tue, 31 Dec 2024 00:26:40 +0800 Subject: [PATCH] update tests/uaf --- tests/support/uaf/df_min/Cargo.toml | 2 +- tests/support/uaf/uaf_drop/Cargo.toml | 2 +- tests/support/uaf/uaf_drop_in_palce/Cargo.toml | 2 +- tests/support/uaf/uaf_drop_in_palce/src/main.rs | 8 -------- tests/support/uaf/uaf_lifetime/Cargo.toml | 2 +- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/support/uaf/df_min/Cargo.toml b/tests/support/uaf/df_min/Cargo.toml index 3843bb0..d327f13 100644 --- a/tests/support/uaf/df_min/Cargo.toml +++ b/tests/support/uaf/df_min/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "safedrop01" +name = "df_main" version = "0.1.0" edition = "2021" diff --git a/tests/support/uaf/uaf_drop/Cargo.toml b/tests/support/uaf/uaf_drop/Cargo.toml index 4f62cc3..28aff2a 100644 --- a/tests/support/uaf/uaf_drop/Cargo.toml +++ b/tests/support/uaf/uaf_drop/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "uaf_00" +name = "uaf_drop" version = "0.1.0" edition = "2021" diff --git a/tests/support/uaf/uaf_drop_in_palce/Cargo.toml b/tests/support/uaf/uaf_drop_in_palce/Cargo.toml index 4f62cc3..ead95ae 100644 --- a/tests/support/uaf/uaf_drop_in_palce/Cargo.toml +++ b/tests/support/uaf/uaf_drop_in_palce/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "uaf_00" +name = "uaf_drop_in_place" version = "0.1.0" edition = "2021" diff --git a/tests/support/uaf/uaf_drop_in_palce/src/main.rs b/tests/support/uaf/uaf_drop_in_palce/src/main.rs index cad970b..6a9c3ff 100644 --- a/tests/support/uaf/uaf_drop_in_palce/src/main.rs +++ b/tests/support/uaf/uaf_drop_in_palce/src/main.rs @@ -1,6 +1,5 @@ #![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; @@ -8,11 +7,4 @@ fn main() { 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(()); } diff --git a/tests/support/uaf/uaf_lifetime/Cargo.toml b/tests/support/uaf/uaf_lifetime/Cargo.toml index 4f62cc3..272a32d 100644 --- a/tests/support/uaf/uaf_lifetime/Cargo.toml +++ b/tests/support/uaf/uaf_lifetime/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "uaf_00" +name = "uaf_lifetime" version = "0.1.0" edition = "2021"