#3775: Allow decompressed packets to grow to max capacity

Do not use size as max capacity, as its possible that the entity
rewriter increases the size afterwards. This would result in a kick (it
happens rarely as the entity ids size must differ).
This commit is contained in:
Outfluencer 2025-01-29 07:52:09 +11:00 committed by md_5
parent 6b22690971
commit 4fded9828f
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -41,7 +41,9 @@ public class PacketDecompressor extends MessageToMessageDecoder<ByteBuf>
throw new OverflowPacketException( "Packet may not be larger than " + MAX_DECOMPRESSED_LEN + " bytes" );
}
ByteBuf decompressed = ctx.alloc().directBuffer( size, size );
// Do not use size as max capacity, as its possible that the entity rewriter increases the size afterwards
// This would result in a kick (it happens rarely as the entity ids size must differ)
ByteBuf decompressed = ctx.alloc().directBuffer( size, MAX_DECOMPRESSED_LEN );
try
{
zlib.process( in, decompressed );