-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for defining custom mutators #79
Conversation
This adds support for defining custom mutators, as described in https://github.com/google/fuzzing/blob/master/docs/structure-aware-fuzzing.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows users to force libfuzzer to only perform shrinking mutations.
Thanks for review @Manishearth @frewsxcv! I've pushed a tiny commit that adds a I'll merge and cut a release as soon as CI is green! |
Published! |
See the doc comments for the
fuzz_mutator!
macro for example usage and user-level information.There is some slightly funky stuff going on with
data
,size
, andmax_size
that doesn't feel 100% Rust-y / is a little subtle to support size-aware mutations.data
is basically avec
's heap allocation,size
is basicallyvec.len()
, andmax(size, max_size)
is basicallyvec.capacity()
. Not sure that this API can really be improved upon while remaining a thin wrapper over what libfuzzer gives us (i.e. doesn't introduce a ~fork ofstd::vec::Vec
) but I'm open to ideas!Supersedes #62.