mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
ZIP files with a comment larger than 4096 throws exception #428
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @elephantflea on GitHub (Dec 13, 2020).
If a ZIP file has a comment attached to the archive (not an entry) and it is over 4096 bytes it cannot be extracted as it will throw the exception:
SharpCompress.Common.ArchiveException: Could not find Zip file Directory at the end of the file. File may be corrupted.When a call to list all entries is made. eg using LongComment.zip
I assume this is because of the constant
MAX_ITERATIONS_FOR_DIRECTORY_HEADERinSeekableZipHeaderFactory.cs, but I would think there is a way to factor in the archive comment length into this logic.