From: Jung-uk Kim Date: Mon, 1 Apr 2013 21:02:18 +0000 (-0400) Subject: Do not overwrite file size if the local file header has valid file size. X-Git-Tag: v3.1.900a~351^2~8^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F40%2Fhead;p=thirdparty%2Flibarchive.git Do not overwrite file size if the local file header has valid file size. This allows us to extract index.xml from Apple iWork '09 format files. --- diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c index 450a6f7da..c9fae7f24 100644 --- a/libarchive/archive_read_support_format_zip.c +++ b/libarchive/archive_read_support_format_zip.c @@ -1619,10 +1619,12 @@ process_extra(const char *p, size_t extra_length, struct zip_entry* zip_entry) switch (headerid) { case 0x0001: /* Zip64 extended information extra field. */ - if (datasize >= 8) + if (datasize >= 8 && + zip_entry->uncompressed_size == 0xffffffff) zip_entry->uncompressed_size = archive_le64dec(p + offset); - if (datasize >= 16) + if (datasize >= 16 && + zip_entry->compressed_size == 0xffffffff) zip_entry->compressed_size = archive_le64dec(p + offset + 8); break;