-
Notifications
You must be signed in to change notification settings - Fork 79
Closed
Labels
Description
I use your amaizing module to uncompress zip archives from different sources. Archives may be produced via any compression tools and I don't exactly know which tool was used.
I've found a problem on some archives: readEntry()
method fails on directory processing on entry size validation:
if (entry.compressionMethod === 0) {
if (entry.compressedSize !== entry.uncompressedSize) {
var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize;
return emitErrorAndAutoClose(self, new Error(msg));
}
}
Looks like some zip tool constantly set the following local headers for a directory entry:
compressionMethod: 0
compressedSize: 0
uncompressedSize: 4096
Unfortunatelly, I cannot provide zip example for this case because of sensitive data.
What do you think about some boolean option: validate size or skip validation? Or validate directory size or skip validation? If you accept this proposition I'll create pull request with my pleasure.
HiKWang and joshkel