Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validation errors on valid archives #9

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Tulon
Copy link

@Tulon Tulon commented Nov 9, 2022

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.

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.
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.

1 participant