You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/02/06 22:29:12 UTC

[commons-io] branch master updated: Fix CodeQL issue.

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-io.git


The following commit(s) were added to refs/heads/master by this push:
     new aafcd73  Fix CodeQL issue.
aafcd73 is described below

commit aafcd73bc4835342064636f0ba19e08c10453a4a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 6 17:22:23 2022 -0500

    Fix CodeQL issue.
---
 .../org/apache/commons/io/input/UnsynchronizedByteArrayInputStream.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/io/input/UnsynchronizedByteArrayInputStream.java b/src/main/java/org/apache/commons/io/input/UnsynchronizedByteArrayInputStream.java
index 4f96e2e..200c0d7 100644
--- a/src/main/java/org/apache/commons/io/input/UnsynchronizedByteArrayInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/UnsynchronizedByteArrayInputStream.java
@@ -180,7 +180,7 @@ public class UnsynchronizedByteArrayInputStream extends InputStream {
             actualSkip = n;
         }
 
-        offset += actualSkip;
+        offset = Math.addExact(offset, Math.toIntExact(n));
         return actualSkip;
     }
 }