Skip to content

Reapply gzip FEXTRA XLEN overflow fix to release - #1433

Merged
adamhathcock merged 4 commits into
releasefrom
rebuild/release-04-gzip-extra-field
Oct 9, 2026
Merged

adamhathcock merged 4 commits into
releasefrom
rebuild/release-04-gzip-extra-field

Conversation

@adamhathcock

Copy link
Copy Markdown
Owner

Summary

Reapplies #1428 to the clean release history after the accidental master merge was removed.

Handle the full unsigned 16-bit GZip extra-field length range in synchronous and asynchronous decompression, with boundary regression tests. This restores the first commit of #1428; the reader/archive follow-up is in the next PR.

Review and merge order

Recovery PR 3 of 5. Depends on #1432. Merge that PR first.

All recovery PRs target release. These branches are stacked, so this diff includes earlier recovery changes until the preceding PRs land. Review the replayed commit above for this PR's specific change. Merge in sequence using merge commits or fast-forward semantics to preserve shared ancestry; squash/rebase merging would require restacking the later branches.

The RAR comment test correction (e5c3ec6a) is already present in the clean base, so its checkpoint branch needs no separate PR. No master-only commits were replayed.

Validation

Validated the completed recovery stack on .NET 10:

  • Targeted regression suite: 247 tests passed.
  • Full test suite: 2,017 tests passed.
  • dotnet csharpier check . passed.
  • Working tree clean after formatting.

Validation was performed on the final stack, not separately on every intermediate branch.

NotAFlightRisk and others added 3 commits October 9, 2026 11:56
Reset scan-specific encryption state in sync and async header readers while retaining the KDF cache. Add RAR4/RAR5 rescan and solid encrypted extraction regression coverage.

Fixes #1422

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The XLEN fix is correct and has focused sync/async boundary coverage, with prerequisite PR #1432 required to merge first.

0 open findings

What changed in this PR

Reapplies the GZip FEXTRA unsigned XLEN fix to release, alongside inherited changes from prerequisite recovery PRs.

Changes:

  • Supports GZip extra-field lengths through 65,535 in synchronous and asynchronous decompression.
  • Adds boundary regression tests for XLEN values 32,767, 32,768, and 65,535.
  • Includes stacked ZIP multipart and encrypted RAR rescan fixes.
File Description
src/​SharpCompress/​Compressors/​Deflate/​ZlibBaseStream.cs Parses XLEN without signed truncation.
tests/​SharpCompress.Test/​GZip/​GZipExtraFieldTests.cs Tests synchronous and asynchronous XLEN boundaries.
src/​SharpCompress/​Archives/​Zip/​ZipArchiveVolumeFactory.cs Normalizes uppercase ZIP extensions.
tests/​SharpCompress.Test/​Zip/​ZipArchiveTests.cs Covers uppercase multipart ZIP discovery.
src/​SharpCompress/​Common/​Rar/​Headers/​RarHeaderFactory.cs Resets synchronous encrypted-header scan state.
src/​SharpCompress/​Common/​Rar/​Headers/​RarHeaderFactory.Async.cs Resets asynchronous scan state.
tests/​SharpCompress.Test/​Rar/​RarEncryptedHeaderScanTests.cs Covers encrypted rescans and solid extraction.
tests/​TestArchives/​Archives/​Rar5.solid.encrypted_headers.rar Supplies the solid encrypted RAR5 fixture.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

AsyncOnlyStream and EntryStream have no DisposeAsync on net48, so
await using fails to compile for that target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamhathcock
adamhathcock merged commit 7ef422d into release Oct 9, 2026
3 checks passed
@adamhathcock
adamhathcock deleted the rebuild/release-04-gzip-extra-field branch October 9, 2026 13:50
This was referenced Oct 9, 2026
This was referenced Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants