This commit is contained in:
Looly 2023-01-16 19:12:27 +08:00
parent 43f4f4f6ec
commit 61c10f7b52

View File

@ -555,8 +555,9 @@ public class ZipUtil {
if (limit > 0) {
final Enumeration<? extends ZipEntry> zipEntries = zipFile.entries();
long zipFileSize = 0L;
ZipEntry zipEntry;
while (zipEntries.hasMoreElements()) {
ZipEntry zipEntry = zipEntries.nextElement();
zipEntry = zipEntries.nextElement();
zipFileSize += zipEntry.getSize();
if (zipFileSize > limit) {
throw new IllegalArgumentException("The file size exceeds the limit");