Update fuzz tests to released crowbar API #244
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #237 (comment), @hannesm noted that some cstruct functions can be used to access memory outside of the original cstruct (but inside the original buffer), which seems a bit surprising. I noticed that the fuzz tests actually check for the safer behaviour, so I tried running them to see why they were passing. It turns out that they have bit-rotted and no longer compile.
This PR updates the tests to use the released crowbar API. I ran afl-fuzz on fuzz.exe, after a few minutes it reported three failures:
That is:
I'm not sure what we expect the correct behaviour to be here, but either the tests or the code should be changed.