From 039900a278238965bc678168341cfeba9d95baa6 Mon Sep 17 00:00:00 2001 From: Ruffalo Lavoisier Date: Thu, 5 Feb 2026 05:29:16 +0900 Subject: [PATCH] fix(zip): check uncompressed size exceeds the maximum value of an integer (PR #2773) * check whether it exceeds the maximum value of an integer --------- Co-authored-by: skylot <118523+skylot@users.noreply.github.com> --- .../jadx-zip/src/main/java/jadx/zip/parser/ZipDeflate.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/ZipDeflate.java b/jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/ZipDeflate.java index 625d73e9b..8249bd778 100644 --- a/jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/ZipDeflate.java +++ b/jadx-commons/jadx-zip/src/main/java/jadx/zip/parser/ZipDeflate.java @@ -15,6 +15,9 @@ final class ZipDeflate { buf.position(entry.getDataStart()); ByteBuffer entryBuf = buf.slice(); entryBuf.limit((int) entry.getCompressedSize()); + if (entry.getUncompressedSize() > Integer.MAX_VALUE) { + throw new DataFormatException("Entry too large: " + entry.getUncompressedSize()); + } byte[] out = new byte[(int) entry.getUncompressedSize()]; Inflater inflater = new Inflater(true); inflater.setInput(entryBuf);