Fix validation errors on valid archives #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was getting the following error with one of my archives:
sunzip error: compressed data corrupted, check values mismatch in entry #3617 at offset 0x1119fc19 sunzip abort: zip file corrupted -- cannot continue
Unfortunately I can't share the archive itself, but I've found a problem in sunzip that causes this validation error.
The problem was the value of in->count being modified as a side effect of reading the data descriptor with get*() calls. Then, the GOOD() macro was comparing against that modified value, which was causing the validation error.
Such a situation may happen when the value of strm->avail_in after the inflateBack() call is smaller than the size of the data descriptor following the compressed data.