From 96482cc0cf124328c3bca86277de69ad1ffef6a6 Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Thu, 22 Jul 2021 03:42:48 +0200 Subject: [PATCH] #3157: Read only 20 chars for clients below 1.13 in PluginMessages 20 chars is the vanilla limit for all clients below 1.13. We should use this value. --- .../java/net/md_5/bungee/protocol/packet/PluginMessage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c01cf3175..af16ead81 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 @@ -68,7 +68,7 @@ public class PluginMessage extends DefinedPacket @Override public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion) { - tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf ); + tag = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? MODERNISE.apply( readString( buf ) ) : readString( buf, 20 ); int maxSize = direction == ProtocolConstants.Direction.TO_SERVER ? Short.MAX_VALUE : 0x100000; Preconditions.checkArgument( buf.readableBytes() < maxSize ); data = new byte[ buf.readableBytes() ];