package/source/zipapi/ZipFile.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 59a18d3c3ca4f4543e0de616eaf7e5bdc4488383
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Mar 18 10:52:46 2025 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Mar 18 14:37:56 2025 +0100

    tdf#165694 package: log specific message for missing data descriptor bit
    
    Guess based on size of holes.
    
    Change-Id: I6209844dd74164fa56329df8f31eb40664b2b7e1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183062
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins

diff --git a/package/source/zipapi/ZipFile.cxx 
b/package/source/zipapi/ZipFile.cxx
index d03140f1804b..02e8c1b1d6b7 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -1527,6 +1527,12 @@ sal_Int32 ZipFile::readCEN()
             throw ZipException(u"Count != Total"_ustr );
         if (!unallocated.empty())
         {
+            if (std::all_of(unallocated.begin(), unallocated.end(), [](auto 
const& it) {
+                    return it.second - it.first == 12 || it.second - it.first 
== 16;
+                }))
+            {
+                throw ZipException(u"Zip file has holes the size of data 
descriptors; producer forgot to set flag bit 3?"_ustr);
+            }
             throw ZipException(u"Zip file has holes! It will leak!"_ustr);
         }
     }

Reply via email to