mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #528] [MERGED] Ensure TarArchive enumerates all entries #1076
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/528
Author: @DannyBoyk
Created: 7/20/2020
Status: ✅ Merged
Merged: 7/26/2020
Merged by: @adamhathcock
Base:
master← Head:issue_524_tararchive_fails_read_all_entries📝 Commits (1)
d055b34Ensure TarArchive enumerates all entries📊 Changes
3 files changed (+53 additions, -11 deletions)
View changed files
📝
src/SharpCompress/Common/Tar/TarFilePart.cs(+1 -1)📝
src/SharpCompress/Common/Tar/TarReadOnlySubStream.cs(+12 -10)📝
tests/SharpCompress.Test/Tar/TarArchiveTests.cs(+40 -0)📄 Description
While enumerating the entries of a tar file and writing their contents
to disk using TarArchive, it was discovered TarArchive was not properly
discarding padding bytes in the last block of each entry. TarArchive was
sometimes able to recover depending on the number of padding bytes due
to the logic it uses to find the next entry header, but not always.
TarArchive was changed to use TarReadOnlySubStream when opening entries
and TarReadOnlySubstream was changed to ensure all an entry's blocks are
read when it is being disposed.
Fixes adamhathcock/sharpcompress#524
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.