Repository navigation
Conversation
…archive TarArchiveInputStream.readRecord() returned null both at a clean end of input and when fewer than 512 bytes were available, so input shorter than one record, such as a small .tar.gz passed to the TAR reader, was reported as an empty archive. Throw EOFException for a partial record unless the EOF marker has already been read. Generated-by: OpenAI GPT-6 Astra Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Bring the branch up to date with master before review. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Clickin
marked this pull request as ready for review
November 8, 2026 11:38
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.
JIRA: https://issues.apache.org/jira/browse/COMPRESS-645
TarArchiveInputStream.getNextEntry()returnsnullfor non-TAR input shorter than one record, so it looks like an empty archive. A gzipped TAR holding one small file is only 113 bytes. A partial record after a valid entry is dropped the same way. Non-TAR input of 512 bytes or more already fails while parsing the header, andTarFilealready throwsEOFExceptionfor short input.readRecord()now throwsEOFExceptionwhen a read returns some bytes but fewer than a record, unless the EOF marker has already been read. The message follows the other "Truncated TAR archive" messages in the class.Zero-byte input is still an empty archive, an archive without an EOF marker still reads, and padding or garbage after the EOF record is still ignored. There is no format detection and no change to checksum handling.
TarArchiveInputStreamTestcovers the rejected and the unchanged cases. Without the change, three cases fail: 1-byte input, 511-byte input, and a partial record after an entry. The defaultmvnbuild passes on JDK 17, andTarArchiveInputStreamTestpasses on JDK 8.OpenAI GPT-6 Astra wrote the change and the tests; Claude Opus 5.5 reviewed them and wrote this description. The commit carries
Generated-byandAssisted-Bytrailers.mvn; that'smvnon the command line by itself.🤖 Generated with Claude Code