fuzzing setup

This commit is contained in:
Robin Appelman 2022-12-24 19:44:31 +01:00
commit 7535da3250
5 changed files with 62 additions and 7 deletions

View file

@ -19,7 +19,18 @@ path = ".."
members = ["."]
[[bin]]
name = "fuzz_target_1"
path = "fuzz_targets/fuzz_target_1.rs"
name = "fuzz_mdl"
path = "fuzz_targets/mdl.rs"
test = false
doc = false
[[bin]]
name = "fuzz_vtx"
path = "fuzz_targets/vtx.rs"
test = false
doc = false
[[bin]]
name = "fuzz_vvd"
path = "fuzz_targets/vvd.rs"
test = false
doc = false

42
fuzz/flake.lock generated Normal file
View file

@ -0,0 +1,42 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1671883564,
"narHash": "sha256-C15oAtyupmLB3coZY7qzEHXjhtUx/+77olVdqVMruAg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dac57a4eccf1442e8bf4030df6fcbb55883cb682",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "release-22.11",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,6 +1,8 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
// fuzzed code goes here
});
fn fuzz(data: &[u8]) {
let _ = vmdl::Mdl::read(data).ok();
}
fuzz_target!(|data: &[u8]| {fuzz(data)});

View file

@ -2,7 +2,7 @@
use libfuzzer_sys::fuzz_target;
fn fuzz(data: &[u8]) {
let _ = vmdl::Mdl::read(data).ok();
let _ = vmdl::Vtx::read(data).ok();
}
fuzz_target!(|data: &[u8]| {fuzz(data)});

View file

@ -2,7 +2,7 @@
use libfuzzer_sys::fuzz_target;
fn fuzz(data: &[u8]) {
let _ = vmdl::Mdl::read(data).ok();
let _ = vmdl::Vvd::read(data).ok();
}
fuzz_target!(|data: &[u8]| {fuzz(data)});