Skip to content
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

Fix Unstructured::arbitrary_take_rest_iter for collections of collections #159

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Oct 11, 2023

This simply makes it match the behavior of arbitrary_iter. I experimented with more approaches, but I couldn't get anything that was better in terms of balancing simplicity of implementation, ease of understanding the algorithm, and generating all expected values.

This additionally adds a testing helper function for exhaustively generating certain byte buffers and asserting that we generate the expected arbitrary values from those byte buffers.

Fixes #158

…ctions

This simply makes it match the behavior of `arbitrary_iter`. I experimented with
more approaches, but I couldn't get anything that was better in terms of
balancing simplicity of implementation, ease of understanding the algorithm, and
generating all expected values.

This additionally adds a testing helper function for exhaustively generating
certain byte buffers and asserting that we generate the expected arbitrary
values from those byte buffers.

Fixes rust-fuzz#158
@fitzgen fitzgen force-pushed the arbitrary-take-rest-and-collections-of-collections branch from ce38871 to f19fd7a Compare October 11, 2023 17:11
@fitzgen fitzgen merged commit c1fa740 into rust-fuzz:main Oct 11, 2023
5 checks passed
@fitzgen fitzgen deleted the arbitrary-take-rest-and-collections-of-collections branch October 11, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arbitrary::arbitrary_take_rest can't ever decode raw data to vec![vec![]]
2 participants