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

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

commit 997d4b9c61232587e4c329a5baf01108e90fa81f
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Jul 21 08:39:17 2026 -0700

    unpack200.BandSet.sumNonNegative(int[]) throws Pack200Exception instead
    of causing an int overflow.
---
 .../java/org/apache/commons/compress/harmony/unpack200/BandSet.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/commons/compress/harmony/unpack200/BandSet.java 
b/src/main/java/org/apache/commons/compress/harmony/unpack200/BandSet.java
index e72307792..a885208c3 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/BandSet.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/BandSet.java
@@ -55,7 +55,7 @@ static int sumNonNegative(final int[] counts) throws 
Pack200Exception {
             if (count < 0) {
                 throw new Pack200Exception("count < 0");
             }
-            totalCount += count;
+            totalCount = Pack200Exception.addExact(count, totalCount);
         }
         return totalCount;
     }

Reply via email to