You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by mu...@apache.org on 2022/04/25 12:57:57 UTC

[santuario-xml-security-java] branch 2.1.x-fixes updated: UnsyncByteArrayOutputStream throws OutOfMemoryError without message.

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

mullan pushed a commit to branch 2.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/santuario-xml-security-java.git


The following commit(s) were added to refs/heads/2.1.x-fixes by this push:
     new 4440d72b UnsyncByteArrayOutputStream throws OutOfMemoryError without message.
4440d72b is described below

commit 4440d72befb915a2de6b657babcd87cdc1176daa
Author: Sean Mullan <se...@oracle.com>
AuthorDate: Wed Sep 29 08:32:36 2021 -0400

    UnsyncByteArrayOutputStream throws OutOfMemoryError without message.
---
 .../apache/xml/security/utils/UnsyncByteArrayOutputStream.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/xml/security/utils/UnsyncByteArrayOutputStream.java b/src/main/java/org/apache/xml/security/utils/UnsyncByteArrayOutputStream.java
index f70febab..e28dd6f5 100644
--- a/src/main/java/org/apache/xml/security/utils/UnsyncByteArrayOutputStream.java
+++ b/src/main/java/org/apache/xml/security/utils/UnsyncByteArrayOutputStream.java
@@ -42,7 +42,7 @@ public class UnsyncByteArrayOutputStream extends OutputStream  {
 
     public void write(byte[] arg0) {
         if ((VM_ARRAY_INDEX_MAX_VALUE - pos) < arg0.length) {
-            throw new OutOfMemoryError();
+            throw new OutOfMemoryError("Required length exceeds implementation limit");
         }
         int newPos = pos + arg0.length;
         if (newPos > size) {
@@ -54,7 +54,7 @@ public class UnsyncByteArrayOutputStream extends OutputStream  {
 
     public void write(byte[] arg0, int arg1, int arg2) {
         if ((VM_ARRAY_INDEX_MAX_VALUE - pos) < arg2) {
-            throw new OutOfMemoryError();
+            throw new OutOfMemoryError("Required length exceeds implementation limit");
         }
         int newPos = pos + arg2;
         if (newPos > size) {
@@ -66,7 +66,7 @@ public class UnsyncByteArrayOutputStream extends OutputStream  {
 
     public void write(int arg0) {
         if (VM_ARRAY_INDEX_MAX_VALUE - pos == 0) {
-            throw new OutOfMemoryError();
+            throw new OutOfMemoryError("Required length exceeds implementation limit");
         }
         int newPos = pos + 1;
         if (newPos > size) {
@@ -112,4 +112,4 @@ public class UnsyncByteArrayOutputStream extends OutputStream  {
         buf = newBuf;
         size = newSize;
     }
-}
\ No newline at end of file
+}