#fuzzer #json #arbitrary

bin+lib arbitrary-json

A Json generator based on serde_json and arbitrary

2 releases

0.1.1 Feb 23, 2022
0.1.0 Jan 13, 2022

#1568 in Development tools

Download history 47/week @ 2024-07-24 102/week @ 2024-07-31 69/week @ 2024-08-07 169/week @ 2024-08-14 31/week @ 2024-08-21 39/week @ 2024-08-28 62/week @ 2024-09-04 77/week @ 2024-09-11 100/week @ 2024-09-18 104/week @ 2024-09-25 52/week @ 2024-10-02 63/week @ 2024-10-09 117/week @ 2024-10-16 82/week @ 2024-10-23 185/week @ 2024-10-30 47/week @ 2024-11-06

435 downloads per month
Used in 2 crates

WTFPL license

7KB
97 lines

Arbitrary JSON

This crate provide a compatibility layer between serde_json and arbitrary. This allow you to generate random valid json when fuzzing your rust code. See the following example:

#![no_main]
use arbitrary_json::ArbitraryValue;
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: ArbitraryValue| {
    // call your very complex code here
    if data["truc"] == serde_json::json!(42) {
        panic!("Found the magic value");
    }
});

lib.rs:

Arbitrary JSON

This crate provide a compatibility layer between serde_json and arbitrary. This allow you to generate random valid json when fuzzing your rust code. See the following example:

#![no_main]
use arbitrary_json::ArbitraryValue;
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: ArbitraryValue| {
    // call your very complex code here
    if data["truc"] == serde_json::json!(42) {
        panic!("Found the magic value");
    }
});

Dependencies

~0.6–1.1MB
~22K SLoC