#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

#1558 in Development tools

Download history 118/week @ 2024-07-29 14/week @ 2024-08-05 218/week @ 2024-08-12 23/week @ 2024-08-19 52/week @ 2024-08-26 37/week @ 2024-09-02 65/week @ 2024-09-09 114/week @ 2024-09-16 65/week @ 2024-09-23 93/week @ 2024-09-30 56/week @ 2024-10-07 108/week @ 2024-10-14 71/week @ 2024-10-21 174/week @ 2024-10-28 101/week @ 2024-11-04 55/week @ 2024-11-11

404 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