Repository navigation
Fix XLSX loading with 64-bit ZIP data descriptors - #32
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🟢 Approval recommended
Review found no blocking defects, with fixture validation and regression coverage supporting the targeted reader change.
No open issues 🎉
What changed in this PR
Fixes XLSX loading for entries with 64-bit ZIP data descriptors by using the bundled central-directory reader.
Changes:
- Replaces streaming ZIP reads while preserving CRC validation, temporary-stream disposal, and invalid-package handling.
- Adds loading and save/reopen regression tests.
- Configures the synthetic workbook fixture to copy to test output.
| File | Description |
|---|---|
| EPPlusTest/ExcelPackageTests.cs | Adds ZIP64 descriptor regression tests and an input-stream ownership assertion. |
| EPPlusTest/EPPlusTest.Core.csproj | Copies the workbook fixture to test output. |
| EPPlus/Packaging/ZipPackage.cs | Uses central-directory ZIP reading and entry extraction. |
Review effort: Balanced
Loading an XLSX whose entries use 64-bit ZIP data descriptors without local ZIP64 size markers can throw BadReadException because the streaming reader advances to the wrong offset. Read package entries through the bundled ZipFile.Read central-directory reader while preserving CRC checks, temporary-stream disposal, and InvalidDataException for invalid packages.
Adds a 1,764-byte synthetic workbook containing only Sheet1!A1 = "test", with regression tests for reading and saving/reopening it. Both tests reproduce the failure before the fix, so no external workbook data is needed.
Validation:
Summary by CodeRabbit