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

bitstorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/master by this push:
     new 629c696948 guard against integer overflow in write() (#1443)
629c696948 is described below

commit 629c69694890b1bf38b7e35b2151b83d41baa97f
Author: jmestwa-coder <[email protected]>
AuthorDate: Fri Jul 10 21:04:06 2026 +0530

    guard against integer overflow in write() (#1443)
---
 .../main/java/org/apache/wicket/util/io/ByteArrayOutputStream.java    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/wicket-util/src/main/java/org/apache/wicket/util/io/ByteArrayOutputStream.java
 
b/wicket-util/src/main/java/org/apache/wicket/util/io/ByteArrayOutputStream.java
index 228c910ab5..7d752243ca 100644
--- 
a/wicket-util/src/main/java/org/apache/wicket/util/io/ByteArrayOutputStream.java
+++ 
b/wicket-util/src/main/java/org/apache/wicket/util/io/ByteArrayOutputStream.java
@@ -172,6 +172,10 @@ public class ByteArrayOutputStream extends OutputStream
                        return;
                }
                int newcount = count + len;
+               if (newcount < 0)
+               {
+                       throw new IndexOutOfBoundsException("Total size too 
large: " + newcount);
+               }
                int remaining = len;
                int inBufferPos = count - filledBufferSum;
                while (remaining > 0)

Reply via email to