Skip to content

Fix Unstructured::arbitrary_take_rest_iter for collections of collections#159

Merged
fitzgen merged 2 commits intorust-fuzz:mainfrom
fitzgen:arbitrary-take-rest-and-collections-of-collections
Oct 11, 2023
Merged

Fix Unstructured::arbitrary_take_rest_iter for collections of collections#159
fitzgen merged 2 commits intorust-fuzz:mainfrom
fitzgen:arbitrary-take-rest-and-collections-of-collections

Conversation

@fitzgen
Copy link
Copy Markdown
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

@fitzgen fitzgen requested a review from Manishearth October 11, 2023 17:05
…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
@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