From 100c3f07e9317c27c9ab625a24b8958f054f615a Mon Sep 17 00:00:00 2001 From: hauno Date: Sat, 5 Jan 2019 16:21:07 +1100 Subject: [PATCH] Cap Objective Score Length Adds a check for Score arguments that would crash the client --- .../java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java index 4a08f218f7..dcbbea38a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java @@ -110,6 +110,7 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective public Score getScore(String entry) throws IllegalArgumentException, IllegalStateException { Validate.notNull(entry, "Entry cannot be null"); + Validate.isTrue(entry.length() <= 40, "Score '" + entry + "' is longer than the limit of 40 characters"); CraftScoreboard scoreboard = checkState(); return new CraftScore(this, entry);