File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ Barebones wrapper around libFuzzer runtime library.
2
+
3
+ The CPP parts are extracted from llvm git repository with ` git filter-branch ` .
4
+
5
+ # How to use
6
+
7
+ “Manual” usage of this library looks like this:
8
+
9
+ ```
10
+ $ cargo new --bin fuzzed
11
+ $ cd fuzzed
12
+
13
+ $ tail Cargo.toml -n2 # add libfuzzer-sys dependency
14
+ [dependencies]
15
+ fuzzer-sys = { path = "../libfuzzer-sys" } # or something
16
+
17
+ $ cat src/main.rs
18
+ #![no_main]
19
+ extern crate fuzzer_sys;
20
+
21
+ #[export_name="LLVMFuzzerTestOneInput"]
22
+ pub fn go(data: *const u8, size: isize) -> i32 {
23
+ // fuzzed code goes here
24
+ 0
25
+ }
26
+
27
+ $ cargo rustc -- -C passes='sancov' -C llvm-args='-sanitizer-coverage-level=3' -Z sanitizer=address -Cpanic=abort
28
+ $ ./target/debug/fuzzed # runs fuzzing
29
+ ```
30
+
31
+ Nice wrappers incoming soon
You can’t perform that action at this time.
0 commit comments