GoogleChrome / GoogleChrome/ripunzip
Fuzz code doesn't compile
- Dominant language
- Rust
- Stars
- 294
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
It seems like the fuzzer code's gone unused for long enough that it doesn't compile any more:
```
error[E0308]: mismatched types
--> fuzz_targets/fuzz_ripunzip.rs:100:60
|
100 | let ripunzip = ripunzip::UnzipEngine::for_file(file)?;
| ------------------------------- ^^^^ expected `PathBuf`, found `File`
| |
| arguments to this function are incorrect
|
note: associated function defined here
--> /home/willow/Projects/Mine/ripunzip/src/unzip/mod.rs:176:12
|
176 | pub fn for_file(zipfile_path: PathBuf) -> Result {
| ^^^^^^^^
error[E0308]: mismatched types
--> fuzz_targets/fuzz_ripunzip.rs:97:54
|
97 | let ripunzip_result: Result<(), anyhow::Error> = (|| match input.method {
| __________________________-------------------------___^
| | |
| | expected due to this
98 | | Method::File => {
99 | | let file = std::fs::File::open(&zipfile).unwrap();
100 | | let ripunzip = ripunzip::UnzipEngine::for_file(file)?;
... |
117 | | })();
| |________^ expected `Result<(), Error>`, found `Result<(), RipunzipErrors>`
|
= note: expected enum `Result<_, anyhow::Error>`
found enum `Result<_, RipunzipErrors>`
error[E0277]: the trait bound `&ZipMemberFilename: ToString` is not satisfied
--> fuzz_targets/fuzz_ripunzip.rs:156:24
|
156 | zip.start_file(name, options).unwrap();
| ---------- ^^^^ unsatisfied trait bound
| |
| required by a bound introduced by this call
|
help: the trait `std::fmt::Display` is not implemented for `ZipMemberFilename`
--> fuzz_targets/fuzz_ripunzip.rs:44:1
|
44 | struct ZipMemberFilename(Vec);
| ^^^^^^^^^^^^^^^^^^^^^^^^
= note: required for `&ZipMemberFilename` to implement `std::fmt::Display`
= note: required for `&ZipMemberFilename` to implement `ToString`
note: required by a bound in `zip::write::>::start_file`
--> /home/willow/.local/share/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/zip-3.0.0/src/write.rs:1156:26
|
1156 | pub fn start_file(
| ^^^^^^^^ required by this bound in `zip::write::>::start_file`
```
This should perhaps be looked at.
Contributor guide
Research direction
Start with fuzz_targets/fuzz_ripunzip.rs and reproduce the compiler errors for the fuzz target. Check src/unzip/mod.rs at UnzipEngine::for_file and the reported zip writer call sites, then update the fuzz code until it compiles successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100