craftbukkit/nms-patches/net/minecraft/network/chat/IChatFormatted.patch

15 lines
545 B
Diff
Raw Normal View History

--- a/net/minecraft/network/chat/IChatFormatted.java
+++ b/net/minecraft/network/chat/IChatFormatted.java
@@ -90,6 +90,11 @@
StringBuilder stringbuilder = new StringBuilder();
this.visit((s) -> {
+ // CraftBukkit start
+ if (stringbuilder.length() >= Short.MAX_VALUE) {
+ throw new IllegalArgumentException("Component string exceeded maximum length");
+ }
+ // CraftBukkit end
stringbuilder.append(s);
return Optional.empty();
});