From 6343416c0c9bdb47febfa1f7d844572cc58d0769 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Thu, 16 Jul 2015 23:07:30 +0100 Subject: [PATCH] Update the PluginMessage packet to respect the protocol limit changes in 1.8 --- .../java/net/md_5/bungee/protocol/packet/PluginMessage.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java index c3c7cdbe..dd0e634c 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/PluginMessage.java @@ -1,5 +1,6 @@ package net.md_5.bungee.protocol.packet; +import com.google.common.base.Preconditions; import net.md_5.bungee.protocol.DefinedPacket; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; @@ -38,6 +39,8 @@ public class PluginMessage extends DefinedPacket data = readArrayLegacy( buf ); } else { + int maxSize = direction == ProtocolConstants.Direction.TO_SERVER ? Short.MAX_VALUE : 0x100000; + Preconditions.checkArgument(buf.readableBytes() < maxSize); data = new byte[ buf.readableBytes() ]; buf.readBytes( data ); }