[PR #972] [MERGED] Handle vendor-specific and malformed ZIP extra fields safely #1387

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

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/972
Author: @TwanVanDongen
Created: 10/24/2025
Status: Merged
Merged: 10/25/2025
Merged by: @adamhathcock

Base: masterHead: master


📝 Commits (1)

  • 6d652a1 And again forgot to apply CSharpierAdds bounds checks to prevent exceptions when extra fields are truncated or non-standard (e.g., 0x4341 "AC"/ARC0). Stops parsing gracefully, allowing other fields to be processed.

📊 Changes

2 files changed (+22 additions, -5 deletions)

View changed files

📝 src/SharpCompress/Common/Zip/Headers/ZipFileEntry.cs (+19 -2)
📝 src/SharpCompress/packages.lock.json (+3 -3)

📄 Description

Adds bounds checks to prevent exceptions when extra fields are truncated or non-standard (e.g., 0x4341 "AC"/ARC0). Stops parsing gracefully, allowing other fields to be processed.


🔄 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/972 **Author:** [@TwanVanDongen](https://github.com/TwanVanDongen) **Created:** 10/24/2025 **Status:** ✅ Merged **Merged:** 10/25/2025 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`6d652a1`](https://github.com/adamhathcock/sharpcompress/commit/6d652a12ee037c965676af04ff4aa08da7e7d300) And again forgot to apply CSharpierAdds bounds checks to prevent exceptions when extra fields are truncated or non-standard (e.g., 0x4341 "AC"/ARC0). Stops parsing gracefully, allowing other fields to be processed. ### 📊 Changes **2 files changed** (+22 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Common/Zip/Headers/ZipFileEntry.cs` (+19 -2) 📝 `src/SharpCompress/packages.lock.json` (+3 -3) </details> ### 📄 Description Adds bounds checks to prevent exceptions when extra fields are truncated or non-standard (e.g., 0x4341 "AC"/ARC0). Stops parsing gracefully, allowing other fields to be processed. --- <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:20:19 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1387