-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
UNZ_BADZIPFILE due to incorrect offset of central directory record #44
Comments
Is there any way I could help to resolve this issue? Thanks! |
It appears to be a problem with the ZIP64 end of central directory headers. Normally if those ZIP64 headers exists, then certain values in the non-ZIP64 central directory are set to 0xffffffff. See unzip.c line ~ 461: ((us.gi.number_entry == 0xffff) || (us.size_central_dir == 0xffff) || (us.offset_central_dir == 0xffffffff))). In this particular archive however, it does not set those values. |
I have modified minizip to look for the ZIP64 end of central directory regardless of those values. |
Thank you very much for fixing this! |
Hello, I have a problem opening the file in the link: |
Please open a new issue. |
A user of my DualBootPatcher project, which uses minizip, let me know that this particular zip file was having trouble being opened: https://drive.google.com/file/d/0B3vBKWqY-uX-QkdCd3BpQ1F1Yzg/view (I apologize for the large file size. I don't know how the file was created, so I couldn't create a smaller sample file.)
I did some digging and it seems that minizip might not be calculating the correct offset of the central directory record. Looking at the output of
zipinfo
, the central directory should be at 968,265,440 bytes: https://gist.github.com/chenxiaolong/22961396f606118c49d4 However, minizip is seeking to 968,265,516 bytes and failing because the central directory magic doesn't match.From
unz64local_GetCurrentFileInfoInternal
inunzip.c
, it appears thats->pos_in_central_dir
already has the correct offset ands->byte_before_the_zipfile
might be throwing the value off.Any ideas why this might be happening?
Thanks in advance!
I just added a few printf's to see what minizip is doing:
Output:
The text was updated successfully, but these errors were encountered: