Closed nvinson closed 9 months ago
Is there anything preventing this patch from being merged?
I can't comment on this properly due to github/roadmap#347.
The full code fragment looks like this:
___ /* a ZIP64 extended block may follow. */
size_t csize = zzip_file_header_csize(header);
off_t offset = zzip_file_header_to_data(header);
if (csize == 0xFFFFu) {
struct zzip_extra_zip64* zip64 =
zzip_file_header_to_extras(header);
if (ZZIP_EXTRA_ZIP64_CHECK(zip64)) {
csize = zzip_extra_zip64_csize(zip64);
}
}
if (offset == 0xFFFFu) {
struct zzip_extra_zip64* zip64 =
zzip_file_header_to_extras(header);
if (ZZIP_EXTRA_ZIP64_CHECK(zip64)) {
offset = zzip_extra_zip64_offset(zip64);
}
}
…
file->zlib.next_in = offset;
This looks like a real bug to me: As a de-facto pointer comparison, offset == 0xFFFFu
can never be true. If there is a ZIP64 header, offset
is never adjusted, so the decompression starts at the wrong offset. I suspect the offset
adjustment needs to be moved under the csize
check, and the second if
statement should be deleted. The offset
variable should a pointer, considering how it is used in the end.
Calling ot offset was wrong from the start - I implemented a different approach on develop
Calling ot offset was wrong from the start - I implemented a different approach on develop
@gdraheim Thanks. Is this commit bf539bd6a434f56f7ad7685fc0bc8496f652b5e8?
Fixes gdraheim/zziplib#140
Signed-off-by: Nicholas Vinson nvinson234@gmail.com