This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git


The following commit(s) were added to refs/heads/master by this push:
     new 17d6ca5c1 Better memory guard
17d6ca5c1 is described below

commit 17d6ca5c1e03903938d2fc2cce2580662e81ab0e
Author: Gary D. Gregory <[email protected]>
AuthorDate: Wed Aug 20 08:48:24 2025 -0400

    Better memory guard
---
 .../compress/harmony/unpack200/bytecode/forms/LookupSwitchForm.java     | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/LookupSwitchForm.java
 
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/LookupSwitchForm.java
index 5112c9a9c..1adbbc088 100644
--- 
a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/LookupSwitchForm.java
+++ 
b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/forms/LookupSwitchForm.java
@@ -45,6 +45,8 @@ public LookupSwitchForm(final int opcode, final String name) {
     public void setByteCodeOperands(final ByteCode byteCode, final 
OperandManager operandManager, final int codeLength) throws Pack200Exception {
         final int caseCount = operandManager.nextCaseCount();
         final int defaultPc = operandManager.nextLabel();
+        // Check all at once here for all arrays in this method to account for 
failures seen in GH CI.
+        Pack200Exception.checkIntArray(caseCount * 5); // yeah, might overflow.
         final int[] caseValues = new 
int[Pack200Exception.checkIntArray(caseCount)];
         Arrays.setAll(caseValues, i -> operandManager.nextCaseValues());
         final int[] casePcs = new 
int[Pack200Exception.checkIntArray(caseCount)];

Reply via email to