Skip to content

Conversation

@pathartl
Copy link
Contributor

When a ZIP64 entry is extracted from an archive, the header for the next entry is read out of order. This commit reads the header again, then resets the position of the RewindableStream back to the beginning of the entry, just after the 4 byte header signature. This ensures the correct header signature data and reader (in the correct position) are fed to ReadHeader. Previously this would have read the data at an incorrect offset and would not yield a viable ZipHeader.

I haven't done extensive testing with this nor did I write any automated tests.

pathartl added 2 commits June 23, 2024 22:29
The last commit made in this branch messed up some ZIP reading and caused a bunch of tests to fail. These changes branch off ZIP64 logic into its own block so that data is read correctly for 64 and non-64 entries.
Reorders this null reference check to avoid throwing a null reference exception.
@pathartl
Copy link
Contributor Author

Not sure why tests are failing here... is format formatting issues? Running all tests through VS pass.

@adamhathcock
Copy link
Owner

format is using csharpier to enforce a code style. The dotnet tool is available locally and dotnet csharpier . should fix the formatting

@adamhathcock adamhathcock merged commit d18cad6 into adamhathcock:master Jun 26, 2024
@adamhathcock
Copy link
Owner

Thanks!

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.

2 participants