110 Commits

Author SHA1 Message Date
Adam Hathcock
85bf5141e6 Reject unsupported Zstandard window limits at assignment 2026-11-13 09:31:43 +00:00
Adam Hathcock
b76c336658 Merge remote-tracking branch 'origin/release' into adam/merge-release-into-master
# Conflicts:
#	.github/workflows/nuget-release.yml
#	src/SharpCompress/Common/SevenZip/ArchiveReader.Async.cs
#	src/SharpCompress/Common/SevenZip/ArchiveReader.cs
2026-11-12 16:52:39 +00:00
Adam Hathcock
760eef37ab Merge commit from fork
Fix GHSA-xmfm-xg76-qx62: bound decompression dictionary allocations
2026-11-12 15:09:10 +00:00
Adam Hathcock
cecd8543a4 Bound decompression dictionaries with static size limits 2026-11-09 13:23:53 +00:00
Adam Hathcock
8ec2188ee0 Validate 7z header counts before allocation
Bound nested metadata counts and coder properties by their backing data, validate file and stream consistency, and buffer decoded headers incrementally instead of reserving attacker-declared output sizes.

Add synchronous and asynchronous allocation regressions for GHSA-vwpg-q8vc-g6fg, including external metadata and valid bit-packed empty entries.
2026-11-09 11:53:34 +00:00
Adam Hathcock
dd6d09c6d2 Reduce allocations in 7z encryption and codec lookup 2026-10-26 13:45:21 +00:00
Adam Hathcock
2fa1dec513 Merge pull request #1473 from adamhathcock/review/fix-zip64-descriptor-width
Fix ZIP64 streaming data descriptor width parsing
2026-10-26 11:36:16 +00:00
Adam Hathcock
f83502bd64 Record full XZ follow-up validation and fast-path CPU trace 2026-10-24 13:44:34 +01:00
Adam Hathcock
ba248dc01e Decode asynchronously buffered LZMA2 chunks with the fast CPU path 2026-10-24 13:37:15 +01:00
Adam Hathcock
31f3476fc9 Add native ValueTask memory reads through XZ filter chains 2026-10-24 13:09:51 +01:00
Adam Hathcock
de7a5d9ad4 Avoid duplicate task results in XZ BCJ array reads 2026-10-24 12:54:39 +01:00
Adam Hathcock
d755de5170 Record XZ CPU and allocation trace attribution 2026-10-24 12:45:16 +01:00
Adam Hathcock
f7451966ec Document XZ BCJ pooling evaluation and add benchmarks 2026-10-24 12:42:57 +01:00
Adam Hathcock
ee30126370 Fix ZIP64 streaming data descriptor width parsing 2026-10-24 11:50:31 +01:00
Adam Hathcock
b8e81bd3f5 Split ArchiveFactory into focused public entry points 2026-10-21 11:47:47 +01:00
Adam Hathcock
068da202e4 Expose default services directly through LibraryDefaults 2026-10-21 09:46:38 +01:00
Adam Hathcock
e21da75de2 Split DI services into focused workflow components 2026-10-21 09:27:47 +01:00
Adam Hathcock
4cc8d6b257 Use generated internal interfaces for DI services 2026-10-21 09:12:42 +01:00
Adam Hathcock
b578325982 Move extension workflows into internal services 2026-10-21 08:57:36 +01:00
Adam Hathcock
740ae8fa89 Refactor factory workflows into internal Pure.DI services 2026-10-21 08:42:00 +01:00
Adam Hathcock
2463488de7 Merge remote-tracking branch 'origin/master' into feature/non-seekable-zip64-writing
# Conflicts:
#	src/SharpCompress/Factories/TarFactory.cs
#	src/SharpCompress/Readers/Tar/TarReader.Factory.cs
#	src/SharpCompress/Readers/Tar/TarReader.cs
#	tests/SharpCompress.Test/Streams/RarLifetimeTests.cs
#	tests/SharpCompress.Test/Streams/SevenZipLifetimeTests.cs
#	tests/SharpCompress.Test/Streams/TarLifetimeTests.cs
2026-10-20 11:41:45 +01:00
Adam Hathcock
714a27fd40 Fix RAR checksum handling for empty reads and checksum-free entries 2026-10-20 11:11:43 +01:00
Adam Hathcock
5efd391725 Merge remote-tracking branch 'origin/master' into perf/rar-profile-pooling 2026-10-20 11:07:23 +01:00
Adam Hathcock
bae154799d Merge pull request #1461 from adamhathcock/perf/zip-profile-pooling
Reduce Deflate read and Huffman scratch allocations
2026-10-20 11:05:49 +01:00
Adam Hathcock
3f6ba78e22 Document ring-buffer allocation profiling results 2026-10-20 10:57:04 +01:00
Adam Hathcock
7731843e25 Reduce Deflate read and Huffman scratch allocations
Use a ValueTask read core and memory-based compressed-input refills on modern targets, replace per-block Huffman output arrays with scalar parameters, and decode directly into array-backed caller memory with a pooled fallback.

Preserve generated sync array-read semantics and clear codec output references after reads. Add slice, fallback, cancellation, failure, tree-validation, and read-ahead coverage; document staged ZIP profiles.

Validation: 2,989 .NET 10 tests passed; all library targets, net48 tests, and performance project compile; formatting checks pass.
2026-10-20 09:56:54 +01:00
Adam Hathcock
76481ac615 Summarize the latest merged 7z profiling results
Replace historical profiling rounds with a self-contained report for the origin/master merge comparison, including allocation results, timing variability, validation, and reproduction artifacts.
2026-10-20 08:44:24 +01:00
Adam Hathcock
f41cc208cc Pool LZMA workspaces and streamline 7z metadata writing
Reuse LZMA2 trial decoders and pooled compressed output, pool and consolidate decoder probability banks, lazily rent encoder optimization scratch, and avoid copying direct async memory writes.

Use bounded stack scratch and stream 7z metadata without temporary property buffers. Add ownership, failure, context-shrink, Unicode, and block-boundary regressions.

Document allocation profiles, the small-file LZMA2 throughput tradeoff, and rejection of exact-size match-finder arrays. Validation: 3,016 .NET 10 tests passed; all library targets, net48 tests, and performance project compile; formatting checks pass.
2026-10-20 08:28:23 +01:00
Adam Hathcock
030569611e Reduce 7z copy and LZMA decoder allocations
Pool writer CRC-copy buffers, use memory-based async read overloads on modern targets, reuse LZMA2 decoders across resets, and initialize probability-model banks lazily.

Add reset/property-change, memory-read, writer boundary/CRC, and growth regression coverage. Document staged profiling results and rejection of dictionary-growth policies that regress small-file allocations.

Validation: 2,997 .NET 10 Release tests passed, all library targets built, net48 tests compiled, and formatting checks passed.
2026-10-19 15:11:47 +01:00
Adam Hathcock
14d77b671c Release pooled 7z decoder buffers across async and partial reads
Dispose cached folder decoders during async archive cleanup and scope temporary encoded-header decoders in both read paths. Release LZMA range-decoder input buffers on partial reads and failures while preserving borrowed source ownership.

Correct the synchronous extraction-reader benchmark and expand lifetime and checksum coverage. Document profiling showing async Archive allocations falling from 8.95 MiB to 0.70 MiB per extraction, with metadata-only allocations reduced by 70%.

Validation: 2,989 .NET 10 Release tests passed; all library targets, the performance project, and net48 test compilation succeeded. Formatting and whitespace checks passed.
2026-10-19 14:43:51 +01:00
Adam Hathcock
81879e9de4 Pool RAR Huffman scratch buffers and validate async checksums
Reuse unpacker-owned pooled scratch arrays for async RAR5 and RAR2 Huffman tables, preserving alphabet bounds and zeroed history tails. Match async Archive CRC32/BLAKE2sp verification to the synchronous path and dispose entry streams when initialization fails.

Add regression tests and profiling documentation showing approximately 3.13 MiB fewer managed allocations per 200 MiB extraction. Keep this change based directly on master without unrelated branch commits.

Validation: 2,983 .NET 10 Release tests passed, all six library targets built, net48 tests compiled, and formatting checks passed.
2026-10-19 14:10:30 +01:00
Adam Hathcock
0fbf36d602 Merge remote-tracking branch 'origin/release'
# Conflicts:
#	src/SharpCompress/Compressors/LZMA/LZ/LzOutWindow.cs
#	src/SharpCompress/Compressors/LZMA/LzmaStream.cs
2026-10-19 11:15:09 +01:00
Adam Hathcock
4966fc186b Merge branch 'release' into fix/lzma2-truncated-header
# Conflicts:
#	src/SharpCompress/Compressors/LZMA/LZ/LzOutWindow.cs
2026-10-19 09:59:33 +01:00
Adam Hathcock
2369f10b63 Grow LZMA dictionary storage only as decoded history requires 2026-10-16 15:39:56 +01:00
Adam Hathcock
8a9b76dd44 Grow Shrink output from decoded bytes and stop at input EOF 2026-10-16 15:35:27 +01:00
Adam Hathcock
0860da8bc5 Buffer ARC LZW input incrementally and reject truncated entries 2026-10-16 15:34:07 +01:00
Adam Hathcock
9b0be6f984 Skip ZIP64 extensible data without size-driven allocations 2026-10-16 15:33:10 +01:00
Adam Hathcock
cae625fc05 Support ZIP64 writing to non-seekable streams 2026-10-15 18:17:39 +01:00
Adam Hathcock
e58fcb23e5 Preserve async disposal across all supported frameworks 2026-10-13 12:57:14 +01:00
Adam Hathcock
d431c80b38 Fix WinZip AES authentication retry after cancellation 2026-10-13 12:23:24 +01:00
Adam Hathcock
a47e02e4cd Merge branch 'master' into adam/release-dependencies-and-async-stream-fixes 2026-10-13 11:40:46 +01:00
Adam Hathcock
1fb8ac1724 Merge remote-tracking branch 'origin/release'
# Conflicts:
#	src/SharpCompress/Compressors/LZMA/LzmaStream.Async.cs
#	src/SharpCompress/Compressors/LZMA/LzmaStream.cs
2026-10-13 11:39:15 +01:00
Adam Hathcock
1080969e51 Fix async writable entry streams and cross-framework disposal 2026-10-13 11:36:07 +01:00
Adam Hathcock
ba8d0f84b1 Merge remote-tracking branch 'origin/release'
# Conflicts:
#	src/SharpCompress/Common/GZip/GZipChecksumValidationStream.cs
#	src/SharpCompress/Common/Zip/WinzipAesCryptoStream.Async.cs
#	src/SharpCompress/Common/Zip/WinzipAesCryptoStream.cs
#	src/SharpCompress/Compressors/Deflate/ZlibBaseStream.cs
2026-10-13 11:00:17 +01:00
Adam Hathcock
bdb42df4dc Make raw LZMA setup and disposal exception-safe 2026-10-13 10:29:07 +01:00
Adam Hathcock
38e3222dc2 Release rewind buffers despite disposal failures and reject disposed reads 2026-10-13 10:26:09 +01:00
Adam Hathcock
c574364838 Fix pooled buffer ownership and exception-safe cleanup 2026-10-13 09:57:19 +01:00
Adam Hathcock
dcd2515598 Merge remote-tracking branch 'origin/release' into fix/1439-sevenzip-password-exceptions
# Conflicts:
#	docs/API.md
2026-10-12 17:10:32 +01:00
Adam Hathcock
a147a7bc29 Merge pull request #1442 from adamhathcock/fix/release-pr-1436-followups
pr 1436 followups
2026-10-12 17:05:28 +01:00
Adam Hathcock
69e1477ee6 Expose public exceptions for encrypted 7z decoding failures 2026-10-12 15:29:40 +01:00