]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Do not overwrite file size if the local file header has valid file size. 40/head
authorJung-uk Kim <jkim@FreeBSD.org>
Mon, 1 Apr 2013 21:02:18 +0000 (17:02 -0400)
committerJung-uk Kim <jkim@FreeBSD.org>
Mon, 1 Apr 2013 21:02:18 +0000 (17:02 -0400)
This allows us to extract index.xml from Apple iWork '09 format files.

libarchive/archive_read_support_format_zip.c

index 450a6f7da51908d6894a0b3b909df087051b40c8..c9fae7f24b84d68ad197e0645e131096aac0d4d3 100644 (file)
@@ -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;