diff --git a/Spigot-Server-Patches/0554-Brand-support.patch b/Spigot-Server-Patches/0554-Brand-support.patch index 5fd277c70..3683eb17a 100644 --- a/Spigot-Server-Patches/0554-Brand-support.patch +++ b/Spigot-Server-Patches/0554-Brand-support.patch @@ -41,7 +41,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + // Paper start - Brand support + if (packetplayincustompayload.tag.equals(MINECRAFT_BRAND)) { -+ this.clientBrandName = data.length < 512 ? new String(data) : "unknown-too-large"; ++ try { ++ this.clientBrandName = new PacketDataSerializer(Unpooled.copiedBuffer(data)).readUTF(256); ++ } catch (StringIndexOutOfBoundsException ex) { ++ this.clientBrandName = "illegal"; ++ } + } + // Paper end server.getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), packetplayincustompayload.tag.toString(), data);