package/source/zipapi/ZipFile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit d22d47e940da3bea13fe20199b5ab410d9d6ac50 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Sep 11 12:06:21 2024 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Fri Sep 13 12:46:56 2024 +0200 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.st...@allotropia.de> 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);