From cf0f429119cc63743cc22a8f6582c2253a847b9b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot 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 By: hauno --- .../java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java | 1 + 1 file changed, 1 insertion(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java index 4a08f218f7..dcbbea38a2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java +++ b/paper-server/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);