activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject activemq-artemis git commit: ARTEMIS-1482 Add back check for SimpleString
Date Wed, 08 Aug 2018 18:24:27 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/2.6.x 32c2382fa -> a3e1efa28


ARTEMIS-1482 Add back check for SimpleString

(cherry picked from commit 985d1e1fcbce7cf02fd1604f9d9255a2c4736008)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/a3e1efa2
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/a3e1efa2
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/a3e1efa2

Branch: refs/heads/2.6.x
Commit: a3e1efa28e77311c9562a77c83d2b3991837c3e0
Parents: 32c2382
Author: Martyn Taylor <mtaylor@redhat.com>
Authored: Wed Aug 8 16:33:11 2018 +0100
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Aug 8 14:24:14 2018 -0400

----------------------------------------------------------------------
 .../java/org/apache/activemq/artemis/api/core/SimpleString.java   | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a3e1efa2/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java
b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java
index b3af64a..96e48b8 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java
@@ -179,6 +179,9 @@ public final class SimpleString implements CharSequence, Serializable,
Comparabl
    }
 
    public static SimpleString readSimpleString(final ByteBuf buffer, final int length) {
+      if (length > buffer.readableBytes()) {
+         throw new IndexOutOfBoundsException();
+      }
       byte[] data = new byte[length];
       buffer.readBytes(data);
       return new SimpleString(data);


Mime
View raw message