Skip to content

Commit a0dac20

Browse files
committed
Add a new test for #11 (edition 2018 and no return value)
1 parent 7feaf85 commit a0dac20

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

examples/neverfree/Cargo.toml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "redhook_ex_neverfree"
3+
version = "0.1.0"
4+
authors = ["Geoffrey Thomas <[email protected]>"]
5+
edition = "2018"
6+
7+
[lib]
8+
name = "neverfree"
9+
crate_type = ["dylib"]
10+
11+
[dependencies.redhook]
12+
path = "../.."

examples/neverfree/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
redhook::hook! {
2+
// Can't have use-after-free vulnerabilities... if you never free anything
3+
unsafe fn free(_ptr: *const ()) => my_free { }
4+
}

test.sh

+4
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ cd examples/readlinkspy
1818
cargo update
1919
cargo build
2020
preload libreadlinkspy ls -l /dev/stdin | grep readlink
21+
22+
cd ../neverfree
23+
cargo update
24+
cargo build

0 commit comments

Comments
 (0)