Skip to content

Conversation

@garydgregory
Copy link
Member

Jira: https://issues.apache.org/jira/browse/COMPRESS-715

  • Read the contribution guidelines for this project.
  • Read the ASF Generative Tooling Guidance if you use Artificial Intelligence (AI).
  • I used AI to create any part of, or all of, this pull request.
  • Run a successful build using the default Maven goal with mvn; that's mvn on the command line by itself.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible, but it is a best practice.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body. Note that a maintainer may squash commits during the merge process.

Comment on lines 840 to 847
if (!sig.equals(ZipLong.LFH_SIG)) {
if (sig.equals(ZipLong.CFH_SIG) || sig.equals(ZipLong.AED_SIG) || isApkSigningBlock(lfhBuf)) {
if (sig.equals(ZipLong.CFH_SIG) || sig.equals(ZipLong.AED_SIG) || isApkSigningBlock(lfhBuf) || sig.equals(ZipLong.ZERO)) {
hitCentralDirectory = true;
skipRemainderOfArchive();
return null;
}
throw new ZipException(String.format("Unexpected record signature: 0x%x", sig.getValue()));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just skip the remainder of the archive here:

if (!sig.equals(ZipLong.LFH_SIG)) {
    hitCentralDirectory = true;
    skipRemainderOfArchive();
    return null;
}

I couldn't find any documentation that describes the process of padding a ZIP file. Therefore, we must assume that the “padding” is just arbitrary data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants