mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #852] [MERGED] Fixed extractions after first ZIP64 entry is read from stream #1282
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?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/852
Author: @pathartl
Created: 6/22/2024
Status: ✅ Merged
Merged: 6/26/2024
Merged by: @adamhathcock
Base:
master← Head:fix-post-zip64-entry-subsequent-extractions📝 Commits (4)
b7b78edFixed extractions after first ZIP64 entry is read from streameee518bReworked ZIP64 handling to separate block9bc0a1dNull reference checkingb89de6cFix formatting📊 Changes
2 files changed (+59 additions, -6 deletions)
View changed files
📝
src/SharpCompress/Common/Zip/StreamingZipHeaderFactory.cs(+57 -4)📝
src/SharpCompress/Common/Zip/ZipHeaderFactory.cs(+2 -2)📄 Description
When a ZIP64 entry is extracted from an archive, the header for the next entry is read out of order. This commit reads the header again, then resets the position of the RewindableStream back to the beginning of the entry, just after the 4 byte header signature. This ensures the correct header signature data and reader (in the correct position) are fed to ReadHeader. Previously this would have read the data at an incorrect offset and would not yield a viable ZipHeader.
I haven't done extensive testing with this nor did I write any automated tests.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.