2 releases
0.1.1 | Feb 23, 2022 |
---|---|
0.1.0 | Jan 13, 2022 |
#1568 in Development tools
435 downloads per month
Used in 2 crates
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