mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
Handle bad extra fields in local file headers in zip files #354
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 @DannyBoyk on GitHub (Jun 3, 2019).
At my work we have to process quite a few zip files whose generation we have very little control over. One of the zips we are receiving is putting custom data in the extras field of the local file header rather than following the 2 byte tag ID, 2 byte value length, and X byte value that the zip format specifies.
I traced 7zips logic on this and they just gracefully bail on further parsing of the extras field if they detect a length for an extra that is greater than the total length of the extras header. I made a similar change in ZipFileEntry and added a corresponding test. I'll be pushing up a branch and making a PR for this issue.
@adamhathcock commented on GitHub (Jun 4, 2019):
Seemed fine to me. Thanks.