Skip to content
Permalink
Browse files

Add initial new fuzz test

  • Loading branch information
Licenser committed Jan 28, 2020
1 parent 01bdba5 commit b0632ba1b5e9ed091172aaecf39dc0920e279f90
Showing with 43 additions and 1 deletion.
  1. +1 −0 data/crash/crash000037.json
  2. +4 −0 fuzz/.gitignore
  3. +28 −0 fuzz/Cargo.toml
  4. +9 −0 fuzz/fuzz_targets/passing.rs
  5. +1 −1 tests/jsonchecker.rs
@@ -0,0 +1 @@
[-
@@ -0,0 +1,4 @@

target
corpus
artifacts
@@ -0,0 +1,28 @@

[package]
name = "simd-json-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.3"

[dependencies.simd-json]
path = ".."

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[[bin]]
name = "fuzz_target_1"
path = "fuzz_targets/fuzz_target_1.rs"

[[bin]]
name = "passing"
path = "fuzz_targets/passing.rs"
@@ -0,0 +1,9 @@
#![no_main]
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
let mut data1 = data.clone().to_vec();
if let Ok(ref jo) = simd_json::to_owned_value(&mut data1) {
jo.to_string();
}
});
@@ -202,6 +202,6 @@ crash!(crash000033);
crash!(crash000034);
crash!(crash000035);
crash!(crash000036);
// crash!(crash000037);
crash!(crash000037);
// crash!(crash000038);
// crash!(crash000039);

0 comments on commit b0632ba

Please sign in to comment.
You can’t perform that action at this time.