Skip to content

fix(write): don't leave a stale tail that completes a fake EOCD in the comment - #1186

Merged
Pr0methean merged 2 commits into
zip-rs:masterfrom
cycle-five:fix-stale-tail-fake-eocd
Oct 26, 2026
Merged

Pr0methean merged 2 commits into
zip-rs:masterfrom
cycle-five:fix-stale-tail-fake-eocd

Conversation

@cycle-five

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

Copy link
Copy Markdown
Contributor

Split out from the long persistent-mode fuzz campaign on #1175 (see the breakdown there); reproduces on master's own stdin harness too.

When finalize can't truncate the stream after an aborted file, fill the
stale tail with 0xFF instead of zeros (only when it is shorter than 0xFF00
bytes), so it can't complete an EOCD record whose signature appears in the
archive comment. Adds a regression test and a fuzz seed.

Tests: new regression test/seed; cargo fmt --check, clippy -D warnings and the new tests pass. (--no-default-features clippy field_reassign_with_default at extra_field.rs:364 fails identically on master.)


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

…e comment

When finalize can't truncate the stream after an aborted file, fill the
stale tail with 0xFF instead of zeros (only when it is shorter than 0xFF00
bytes), so it can't complete an EOCD record whose signature appears in the
archive comment. Adds a regression test and a fuzz seed.
@Pr0methean
Pr0methean added this pull request to the merge queue Oct 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 26, 2026
@Pr0methean
Pr0methean enabled auto-merge October 26, 2026 17:01
@Pr0methean
Pr0methean added this pull request to the merge queue Oct 26, 2026
Merged via the queue into zip-rs:master with commit db0fbf0 Oct 26, 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