-
Notifications
You must be signed in to change notification settings - Fork 995
Zip64 signature found in "standard" file. As a result of "357. LocateBlockWithSignature returns false position. #403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
hmm, I hadn't noticed when I made that previous change for zip64 handling, but looking now I wonder if the 3rd and 4th parameters to LocateBlockWithSignature are correct? If it's looking for the zip 64 end of central directory locator block and the definition of that is
The setting minimumBlockSize to 0 and maximumVariableData to 0x1000 seems wrong? (i.e. should it be 20/0?) |
@Numpsy It should, but that would only speed up the search. What I gather from this is that the problematic zip file contains the magic signature @JanneSaare would you mind posting the output of
(you can remove the file names from the output if they're sensitive) |
Should reduce the chance of finding an incorrect matching magic number by just looking where it should be rather than looking at a range of places?
the offset should always be a location prior to the locator block, so could check for that? (and probably also check that it's a reasonable location including the minimum size of the zip 64 directory) |
…ocatorSignature, take account of the blocks fixed size.
… blocks fixed size. refs icsharpcode#403/icsharpcode#375
This should be fixed by #408 |
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
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)
Expected behavior
A ZipFile object
Actual behavior
End of Stream error.
Version of SharpZipLib
1.2.0
Obtained from (only keep the relevant lines)
The text was updated successfully, but these errors were encountered: