List Archive


Thread Index


From: Jakub Vlášek <>
Subject: Inconsistent zip64 archive generated by Total Commander
Date: Fri, 13 Jan 2017 17:13:01 +0100


I have came across a large 10GB zip with 200k files created on windows by Total Commander. Opening of this file failed with Inconsistent archive error. After some debugging, I have found that the extended_fields' disk_number is not set to ZIP_UINT16_MAX and therefore the file fails to open.

Adding _zip_buffer_skip to _zip_dirent_read() fixed this, however I do not know whether the checks there are intentional and essentially removing them could have some other side effect.

best regards,

    Jakub Vlasek

diff -r 3137cc5667a4 lib/zip_dirent.c
--- a/lib/zip_dirent.c  Wed Jan 11 17:59:15 2017 +0100
+++ b/lib/zip_dirent.c  Thu Jan 12 12:02:18 2017 +0100
@@ -547,6 +547,8 @@
                zde->offset = _zip_buffer_get_64(ef_buffer);
            if (zde->disk_number == ZIP_UINT16_MAX)
                zde->disk_number = _zip_buffer_get_32(buffer);
+           else
+               (void)_zip_buffer_skip(ef_buffer, 4);

         if (!_zip_buffer_eof(ef_buffer)) {

Made by MHonArc.