Skip to content

test(fuzz): count reopens in copy bases when tracking comment shrink - #1222

Merged
Pr0methean merged 1 commit into
zip-rs:masterfrom
cycle-five:fix-fuzz-nested-copy-reopen
Oct 30, 2026
Merged

Pr0methean merged 1 commit into
zip-rs:masterfrom
cycle-five:fix-fuzz-nested-copy-reopen

Conversation

@cycle-five

@cycle-five cycle-five commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes a fuzz harness false positive found in #1210 (run 40805120389, fuzz_write_with_no_features); reproduces on master.

FuzzTestCase::execute only updated comment_len_at_reopen for top-level reopens. A copy's base can reopen the same writer, so a comment shrink after such a reopen padded junk before the first local header while streamable stayed true, and read_zipfile_from_stream failed with Invalid local file header. Now looks through ShallowCopy/DeepCopy bases (not merge sub-writers) when deciding whether an op reopens.

Adds fuzz/write/regressions/nested-copy-comment-shrink-junk.bin and a README entry. replay.sh over in + regressions (1011 inputs) passes; fmt and clippy clean.

  • The PR title must conform to Conventional Commits and start with one of the types specified by the Angular convention.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

A copy's base operation can reopen the top-level writer. execute() only updated comment_len_at_reopen for top-level reopens, so shrinking the comment after such a reopen left junk before the first local header while the harness still required streaming reads to succeed.
@Pr0methean Pr0methean changed the title fix(fuzz): count reopens in copy bases when tracking comment shrink test(fuzz): count reopens in copy bases when tracking comment shrink Oct 30, 2026
@Pr0methean
Pr0methean added this pull request to the merge queue Oct 30, 2026
Merged via the queue into zip-rs:master with commit 94ba454 Oct 30, 2026
135 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants