You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The read and write fuzzers can also receive input over stdin for one-off validation. Note here that the fuzzers can be configured to build in support for DEFLATE, or not:
103
+
```bash
104
+
# Success, no output:
105
+
cargo run --quiet --all-features -p fuzz_read <tests/data/deflate64.zip
106
+
# Error, without deflate64 support:
107
+
cargo run --quiet -p fuzz_read <tests/data/deflate64.zip
108
+
109
+
thread 'main' (537304) panicked at fuzz_read/src/main.rs:40:36:
110
+
called `Result::unwrap()` on an `Err` value: UnsupportedArchive("Compression method not supported")
111
+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
112
+
```
113
+
114
+
The zip creation fuzzer will try to print out a description of the kind of input it translated the input bytes into:
The zip creation fuzzer uses [`arbitrary::Unstructured`](https://docs.rs/arbitrary/latest/arbitrary/struct.Unstructured.html) to convert bytes over stdin to random inputs, so it can be triggered with other sources of random input:
129
+
```bash
130
+
# Usually, the random input is translated into zero test cases:
131
+
head -c50 /dev/random | cargo run --quiet --all-features -p fuzz_write
132
+
# Sometimes, one or more test cases are generated and successfully evaluated:
133
+
head -c50 /dev/random | cargo run --quiet --all-features -p fuzz_write
134
+
writer.set_raw_comment([20, 202])?;
135
+
let mut writer = ZipWriter::new_append(writer.finish()?)?;
0 commit comments