Skip to content

Zip64 signature found in "standard" file. As a result of "357. LocateBlockWithSignature returns false position. #403

@JanneSaare

Description

@JanneSaare

Got a file, ziped by SharpZipLib, that obviously has the signature of ZIP64 some where inside. When unzipping the LocateBlockWithSignature returns a position. This leads to End of Stream error in ZIP64 processing.
I can not send an example file (GDPR)

Steps to reproduce

  1. ZIP archive that in its bitsream has by random the ZIP64 signature.
  2. Try open archive new ZipFile(SelectedCaseFilePath)
  3. LocateBlockWithSignature returns a position resulting in wrong execution path
  4. To debug:
    If, in debug, force "standard" decompression the file opens OK.
    // Zip64 Central Directory skipped if not explicitly needed #357 - always check for the existance of the Zip64 central directory.
    long locatedZip64EndOfCentralDir = LocateBlockWithSignature(ZipConstants.Zip64CentralDirLocatorSignature, locatedEndOfCentralDir, 0, 0x1000); //Returns a position
    if (locatedZip64EndOfCentralDir < 0)

Force execution>> {
if (requireZip64)

Expected behavior

A ZipFile object

Actual behavior

End of Stream error.

Version of SharpZipLib

1.2.0

Obtained from (only keep the relevant lines)

  • Compiled from source, commit: 56cbe99 on 9 Aug
  • Downloaded from GitHub
  • Package installed using NuGet

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions