From 7179dd4c0dd81ac1745f2c588b246bb5a8d699a4 Mon Sep 17 00:00:00 2001 From: Thinkofname Date: Wed, 30 Mar 2016 23:31:17 +0100 Subject: [PATCH] Default readArray to capping to readableBytes instead of Short.MAX_VALUE --- .../src/main/java/net/md_5/bungee/protocol/DefinedPacket.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java index e6fbeefb..2fefc266 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -42,7 +42,7 @@ public abstract class DefinedPacket public static byte[] readArray(ByteBuf buf) { - return readArray( buf, Short.MAX_VALUE ); + return readArray( buf, buf.readableBytes() ); } public static byte[] readArray(ByteBuf buf, int limit)