From 1622581fc988043a29650d20f90f5b43abd4fc53 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 25 Aug 2020 20:03:24 -0400 Subject: [PATCH] Fix some modded clients getting kicked for invalid payload - Fixes #4201 --- Spigot-Server-Patches/0554-Brand-support.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/0554-Brand-support.patch b/Spigot-Server-Patches/0554-Brand-support.patch index a340ec4c8..5fd277c70 100644 --- a/Spigot-Server-Patches/0554-Brand-support.patch +++ b/Spigot-Server-Patches/0554-Brand-support.patch @@ -40,8 +40,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 packetplayincustompayload.data.readBytes(data); + + // Paper start - Brand support -+ if (packetplayincustompayload.tag.equals(MINECRAFT_BRAND)) -+ this.clientBrandName = new PacketDataSerializer(Unpooled.copiedBuffer(data)).readUTF(256); ++ if (packetplayincustompayload.tag.equals(MINECRAFT_BRAND)) { ++ this.clientBrandName = data.length < 512 ? new String(data) : "unknown-too-large"; ++ } + // Paper end server.getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), packetplayincustompayload.tag.toString(), data); } catch (Exception ex) {