Repository: activemq-artemis Updated Branches: refs/heads/2.6.x 0b24d0b69 -> 1cd12c5df
ARTEMIS-1482 Enhance test to ensure len check is done before byte[] init Set the int to Integer.MAX_VALUE thus if the len check is not done before byte[] initialization the test would blow with an OOM. (cherry picked from commit 5d8079845ee3fe1092b84533ae63438d79ad353c) Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3f56f4e4 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3f56f4e4 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3f56f4e4 Branch: refs/heads/2.6.x Commit: 3f56f4e41116eded607201e146006c1e6cfd1ac9 Parents: 0b24d0b Author: Michael André Pearce <[email protected]> Authored: Thu Aug 9 15:54:32 2018 +0100 Committer: Clebert Suconic <[email protected]> Committed: Thu Aug 9 19:13:32 2018 -0400 ---------------------------------------------------------------------- .../java/org/apache/activemq/artemis/utils/SimpleStringTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3f56f4e4/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/SimpleStringTest.java ---------------------------------------------------------------------- diff --git a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/SimpleStringTest.java b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/SimpleStringTest.java index 0498cab..85e5794 100644 --- a/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/SimpleStringTest.java +++ b/artemis-commons/src/test/java/org/apache/activemq/artemis/utils/SimpleStringTest.java @@ -28,7 +28,7 @@ public class SimpleStringTest { @Test public void testOutOfBoundsThrownOnMalformedString() { ByteBuf byteBuffer = ByteBufAllocator.DEFAULT.buffer(5); - byteBuffer.writeInt(100); + byteBuffer.writeInt(Integer.MAX_VALUE); Exception e = null; try {
