From b9b7d91989bb51a36aed682acf0a1725fedb1c15 Mon Sep 17 00:00:00 2001 From: elasota Date: Thu, 17 Mar 2022 13:12:53 -0400 Subject: [PATCH] Reject zip archives with non-zero file count but empty central directory --- PortabilityLayer/ZipFileProxy.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PortabilityLayer/ZipFileProxy.cpp b/PortabilityLayer/ZipFileProxy.cpp index a9003d4..4461839 100644 --- a/PortabilityLayer/ZipFileProxy.cpp +++ b/PortabilityLayer/ZipFileProxy.cpp @@ -324,6 +324,11 @@ namespace PortabilityLayer return nullptr; } } + else + { + if (numFiles == 0) + return nullptr; + } bool failed = false;