Skip to content

Conversation

@piksel
Copy link
Member

@piksel piksel commented Jun 7, 2021

Currently ZipInputStream expects all archive entries to immediately follow the previous one. This is normally the case for archives created in one go, but necessarily true when they have been updated.
This PR allows ZipInputStream to skip any padding between entries and consequently read "direct-updated" archives.

Fixes #639

Curiously, 7-zip does not seem to handle these files either and just show all entries found before the first "padded" one. And of course, when updating it uses the equivalent of ZipFiles FileUpdateMode.Safe to avoid the issue.

@piksel piksel added the zip Related to ZIP file format label Jun 7, 2021
@codecov
Copy link

codecov bot commented Jun 8, 2021

Codecov Report

Merging #642 (77dbae4) into master (bdec777) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #642      +/-   ##
==========================================
+ Coverage   74.54%   74.60%   +0.05%     
==========================================
  Files          72       72              
  Lines        8450     8457       +7     
==========================================
+ Hits         6299     6309      +10     
+ Misses       2151     2148       -3     
Impacted Files Coverage Δ
src/ICSharpCode.SharpZipLib/Zip/ZipInputStream.cs 82.46% <100.00%> (+2.07%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@piksel piksel linked an issue Oct 9, 2021 that may be closed by this pull request
@piksel piksel added this to the v1.4 milestone Oct 10, 2021
@piksel piksel self-assigned this Aug 14, 2022
@piksel piksel added the ready PR ready for merging when appropriate label Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready PR ready for merging when appropriate zip Related to ZIP file format

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICSharpCode.SharpZipLib.Zip.ZipException Wrong Local header signature ZipInputStream cannot read in-place updated archives

2 participants