]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Merge branch 'encryption_detection' of github.com:kwk/libarchive into kwk-encryption_...
authorTim Kientzle <kientzle@gmail.com>
Fri, 20 Dec 2013 04:55:10 +0000 (20:55 -0800)
committerTim Kientzle <kientzle@gmail.com>
Fri, 20 Dec 2013 04:55:10 +0000 (20:55 -0800)
Conflicts:
libarchive/archive_read_support_format_zip.c

1  2 
libarchive/archive.h
libarchive/archive_entry.h
libarchive/archive_read_support_format_mtree.c
libarchive/archive_read_support_format_tar.c
libarchive/archive_read_support_format_zip.c
libarchive/test/CMakeLists.txt

Simple merge
Simple merge
index 06334e80c03e6b5332b8abc4592560af7737fbcc,db2c31f4470cc8dbba0cf49cf2d821c209a45eba..5c25281f226ed6a2fcaad349ff1c99e5da91ace3
@@@ -311,17 -363,19 +363,19 @@@ archive_read_format_zip_seekable_bid(st
        /* Since we've already done the hard work of finding the
           end of central directory record, let's save the important
           information. */
-       zip->central_directory_entries = archive_le16dec(p + 10);
+       zip->central_directory_entries_on_this_disk = archive_le16dec(p + 8);
+       zip->central_directory_entries_total = archive_le16dec(p + 10);
        zip->central_directory_size = archive_le32dec(p + 12);
        zip->central_directory_offset = archive_le32dec(p + 16);
 -      zip->end_of_central_directory_offset = filesize;
 -      
 +      zip->end_of_central_directory_offset = end_of_central_directory_offset;
 +
        /* Just one volume, so central dir must all be on this volume. */
-       if (zip->central_directory_entries != archive_le16dec(p + 8))
+       if (zip->central_directory_entries_total != zip->central_directory_entries_on_this_disk) {
                return 0;
 -      /* Central directory can't extend beyond end of this file. */
+       }
 +      /* Central directory can't extend beyond start of EOCD record. */
        if (zip->central_directory_offset +
 -          (int64_t)zip->central_directory_size > filesize)
 +          (int64_t)zip->central_directory_size > end_of_central_directory_offset)
                return 0;
  
        /* This is just a tiny bit higher than the maximum returned by
index 90da7552ef5cb57f5087a91360c9388f72a83c0e,dc36cc89755799e89b9510eb8d31c8795dfd427b..8c10c906f62c89bda938445346f2a2d69211f02f
@@@ -141,10 -147,11 +147,13 @@@ IF(ENABLE_TEST
      test_read_format_xar.c
      test_read_format_zip.c
      test_read_format_zip_comment_stored.c
+     test_read_format_zip_encryption_data.c
+     test_read_format_zip_encryption_partially.c
+     test_read_format_zip_encryption_header.c
      test_read_format_zip_filename.c
      test_read_format_zip_mac_metadata.c
 +    test_read_format_zip_nofiletype.c
 +    test_read_format_zip_padded.c
      test_read_format_zip_sfx.c
      test_read_large.c
      test_read_pax_truncated.c