Replies: 2 comments 1 reply
-
I understand the question as "I want to call a function: fn example(height: usize, width: usize) but with constraints for height and width". There's a chapter about Structure-Aware Fuzzing, you'd then add any additional constraints as the first thing you do in your fuzz function: fuzz_target!(|height: usize, width: usize| {
if height > 10_000 { return }
if width > 100_000 { return }
// more of your code here
// ...
} You are essentially adding gates, inputs that have higher coverage are often considered "better" by the fuzzer so if you don't like a certain input you can "return early" to give it a lower score. Only inputs that pass all your gates are going to get the fuzzer coverage score from the code you're trying to fuzz. |
Beta Was this translation helpful? Give feedback.
-
You will basically end up passing an For example,
|
Beta Was this translation helpful? Give feedback.
-
E.g. if I'm fuzzing an image encoding library, I want my input to be width & height (with some probability density function - so not a completely arbitrary
usize
- I don't want to fuzz terapixel images), and then a random array of pixels with the same size as width & height.Is there a way to do that? I couldn't see much in the docs about this sort of thing.
Beta Was this translation helpful? Give feedback.
All reactions