diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-09-11 12:06:21 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2024-09-13 12:46:56 +0200 |
commit | d22d47e940da3bea13fe20199b5ab410d9d6ac50 (patch) | |
tree | fb22f8501d93f1ad2bd85b5b4da7907f28bf1453 /package/source | |
parent | dff484283dcd562f60840fb9800800187c013b87 (diff) |
ofz: 22 byte .zip is min size
at which point nPos is 0 on entering this test.
If the buffer does not start with PK\x5\x6 then nPos is decremented
before checking against 0, so nPos is -1 and doesn't throw as an
unhandled .zip.
Change-Id: I4a7fed6e863582324945a75bc077f6346ddd5c23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173208
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'package/source')
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index c5b3b5f9b5ca..5a5e705cdba3 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -1180,11 +1180,11 @@ std::tuple<sal_Int64, sal_Int64, sal_Int64> ZipFile::findCentralDirectory() nEndPos = nPos + nEnd; break; } - nPos--; if (nPos == 0) { throw ZipException(u"Zip END signature not found!"_ustr); } + nPos--; } aGrabber.seek(nEndPos + 4); |