mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
WriteEntryToDirectory with GZipReader fails #628
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 @edwardmjackson on GitHub (Apr 18, 2024).
The generic extraction mechanism implemented in ExtractionMethods.cs appears to fail for GZip files.
Path.Combine throws an exception at
900190cf54/src/SharpCompress/Common/ExtractionMethods.cs (L60)due to fileName being null, which is set here
900190cf54/src/SharpCompress/Common/ExtractionMethods.cs (L39)@edwardmjackson commented on GitHub (Apr 18, 2024):
As a follow up, this is probably a sketchy file header in the gzip file, looking at
900190cf54/src/SharpCompress/Common/GZip/GZipFilePart.cs (L94)Trivial workaround for now:
@adamhathcock commented on GitHub (Apr 18, 2024):
you're saying the entry.Key can be null?
@edwardmjackson commented on GitHub (Apr 22, 2024):
Correct. The ! on this line
900190cf54/src/SharpCompress/Common/GZip/GZipFilePart.cs (L37)is masking it, but it can be null (in possibly wierdly-formed files that open fine in 7Zip)
@adamhathcock commented on GitHub (Apr 23, 2024):
0.37.0 has fixed null support so maybe this isn't an issue now?