Skip to content

Commit

Permalink
Limit fuzzer case input size to sensible sizes (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Apr 11, 2024
1 parent 8d0261a commit fcadc2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion fuzz/fuzz_targets/arbitrary.rs
Expand Up @@ -22,5 +22,7 @@ use libfuzzer_sys::fuzz_target;
mod typed_data;

fuzz_target!(|data: &[u8]| {
typed_data::roundtrip_arbitrary_typed_ron_or_panic(data);
if data.len() < 50_000 {
typed_data::roundtrip_arbitrary_typed_ron_or_panic(data);
}
});
6 changes: 4 additions & 2 deletions fuzz/fuzz_targets/from_str.rs
Expand Up @@ -16,7 +16,9 @@
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &str| {
if let Ok(value) = ron::from_str::<ron::Value>(data) {
let _ = ron::to_string(&value);
if data.len() < 50_000 {
if let Ok(value) = ron::from_str::<ron::Value>(data) {
let _ = ron::to_string(&value);
}
}
});

0 comments on commit fcadc2a

Please sign in to comment.