[PR #611] [MERGED] Allowing to seek empty zip files #1124

Closed
opened 2026-01-29 22:19:06 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/611
Author: @Thunderstr1k3
Created: 9/2/2021
Status: Merged
Merged: 9/12/2021
Merged by: @adamhathcock

Base: masterHead: fix-zipheader-seeking


📝 Commits (1)

  • 3e32e3d Allowing to seek empty zip files

📊 Changes

2 files changed (+24 additions, -1 deletions)

View changed files

📝 src/SharpCompress/Common/Zip/SeekableZipHeaderFactory.cs (+2 -1)
📝 tests/SharpCompress.Test/Zip/ZipArchiveTests.cs (+22 -0)

📄 Description

In our workflow it may happen that we attempt to access zip files that don't actually have any content. Until earlier versions that worked, but with the last implementation of SeekableZipHeaderFactory it fails. I suggest parsing the entire stream instead of skipping the oecd region. Respective unit test is added, too.

If you accept the changes, please publish a new nuget package.

Best regards


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/611 **Author:** [@Thunderstr1k3](https://github.com/Thunderstr1k3) **Created:** 9/2/2021 **Status:** ✅ Merged **Merged:** 9/12/2021 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `fix-zipheader-seeking` --- ### 📝 Commits (1) - [`3e32e3d`](https://github.com/adamhathcock/sharpcompress/commit/3e32e3d7b149a4e519e817ea578943d4096bb642) Allowing to seek empty zip files ### 📊 Changes **2 files changed** (+24 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Common/Zip/SeekableZipHeaderFactory.cs` (+2 -1) 📝 `tests/SharpCompress.Test/Zip/ZipArchiveTests.cs` (+22 -0) </details> ### 📄 Description In our workflow it may happen that we attempt to access zip files that don't actually have any content. Until earlier versions that worked, but with the last implementation of SeekableZipHeaderFactory it fails. I suggest parsing the entire stream instead of skipping the oecd region. Respective unit test is added, too. If you accept the changes, please publish a new nuget package. Best regards --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:19:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1124