mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
[PR #1142] [MERGED] Fix ReadFullyAsync with ArrayPool buffer in SevenZipArchive signature check #1580
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/1142
Author: @Copilot
Created: 1/16/2026
Status: ✅ Merged
Merged: 1/16/2026
Merged by: @adamhathcock
Base:
adam/async-creation← Head:copilot/sub-pr-1132-another-one📝 Commits (2)
4b9b20dInitial planb0fde2bFix ReadFullyAsync call to specify offset and count for ArrayPool buffer📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
src/SharpCompress/Archives/SevenZip/SevenZipArchive.Factory.cs(+1 -1)📄 Description
ArrayPool.Rent(6)may return buffers larger than 6 bytes, butReadFullyAsync(buffer, cancellationToken)attempts to fill the entire buffer, causing reads beyond the intended 6-byte signature.Changes
ReadFullyAsync(buffer, cancellationToken)toReadFullyAsync(buffer, 0, 6, cancellationToken)inSignatureMatchAsyncSignatureMatchwhich correctly usesReadExact(buffer, 0, 6)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.