-
Notifications
You must be signed in to change notification settings - Fork 75
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
Arbitrary::arbitrary_take_rest
can't ever decode raw data to vec![vec![]]
#158
Comments
khokho
changed the title
Oct 5, 2023
Arbitrary::arbitrary_take_rest
can't ever represent vec![vec![]]
Arbitrary::arbitrary_take_rest
can't ever decode entropy to vec![vec![]]
khokho
changed the title
Oct 5, 2023
Arbitrary::arbitrary_take_rest
can't ever decode entropy to vec![vec![]]
Arbitrary::arbitrary_take_rest
can't ever decode raw data to vec![vec![]]
I'm not sure I understand this bug report. Could you describe how the output is different from what you expect? |
I wanted to say that there doesn't exist any combination of random bytes that would result in #![no_main]
use libfuzzer_sys::fuzz_target;
fn run(input: Vec<Vec<u8>>) {
if input == vec![vec![]] {
panic!();
}
}
fuzz_target!(|data: Vec<Vec<u8>>| run(data)); |
fitzgen
added a commit
to fitzgen/rust_arbitrary
that referenced
this issue
Oct 11, 2023
…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
added a commit
to fitzgen/rust_arbitrary
that referenced
this issue
Oct 11, 2023
…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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Due to the way arbitrary guesses the length of last element in
take_rest
logic, there's no way to representvec![vec![]]
using the arbitrary format.output:
The text was updated successfully, but these errors were encountered: