jaime-olivares / zipstorer

A Pure C# Class to Store Files in Zip
MIT License
183 stars 63 forks source link

Large corrupt zip archive takes indefinitely long time to open #37

Closed sepiel closed 3 months ago

sepiel commented 5 years ago

Hello, I'm using ZipStorer with sometimes large zip archives. It could happen that a download of a large zip archive (above 1GB) is interrupted and a corrupt zip archive without central direcotry structure is caused. When opening such a file it takes an indefinitely long time (definitely longer than 10 minutes for 2GB) for the ZipStorer to search the whole zip for a "End of central directory record" (cause it did not exist).

Is there the possibility to get an earlier feedback that the zip archive is corrupted. A possible solution could be to only search in the last MB of the zip for this record? The only variable size in this record is a "comment" value.

It would be valuable to get a quicker feedback of a broken zip.

jaime-olivares commented 3 years ago

Hi, I will need a concrete example, because it may depend on the content.