Repository navigation
Conversation
added 2 commits
October 13, 2026 22:05
incomplete archive
yes, but as explained here. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
When decompressing an archive containing valid zstd frames followed by arbitrary data, the CLI previously reported the input as an unsupported format or unknown header, even though all valid frames had been decompressed successfully.
This change improves the CLI behavior in two cases:
zstd: WARNING: <file>: trailing data after the last frame is ignored0when only trailing data is encountered.--rmis used and trailing data was ignored.zstd: <file>: corrupted or incomplete archive; decoded <N> bytesunsupported formatandunknown headererrors.The implementation tracks whether a frame has already been decoded and records when trailing data was ignored. It also classifies the decoder errors that indicate corruption or an incomplete frame and reports the amount of output decoded before the failure.
The change includes CLI regression tests covering:
--rmbehavior for trailing dataValidation performed:
Result:
One limitation is that arbitrary trailing data and a damaged header of a later frame are not always distinguishable once the later frame's magic number has been corrupted. The current behavior follows the requested trailing-data behavior: the already decoded output is kept, a warning is emitted, and the source is preserved when --rm is used.
Checklist
[x] I searched open pull requests and issues: this problem is not already being addressed.
[x] Bug fix: it comes with a reproducer or a test that fails without the fix.
[ ]Performance change: numbers from repeated runs are included, with CPU, compiler, flags and data.
A gain in one configuration is not a general gain: see the Performance section of CONTRIBUTING.md.
[x] I stated below whether AI or other automated tools were used.
Tools used
Claude Code (Claude Sonnet 5.5) was used to find the code path, write the documentation, and the
tests. I ran and verified the tests locally.
Related to #4831