Skip to content

Commit

Permalink
Do not overwrite file size if the local file header has valid file size.
Browse files Browse the repository at this point in the history
This allows us to extract index.xml from Apple iWork '09 format files.
  • Loading branch information
juikim committed Apr 1, 2013
1 parent af4124d commit e234932
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libarchive/archive_read_support_format_zip.c
Expand Up @@ -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;
Expand Down

0 comments on commit e234932

Please sign in to comment.