From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luna Date: Mon, 29 May 2023 19:34:50 -0300 Subject: [PATCH] Fix component extra empty array exploit diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java index 2873ed7c443ed8c8c57a8b1d3e444d229f10f07b..a2149452ee461002ea74189c5aa49cddd943d0cf 100644 --- a/src/main/java/net/minecraft/network/chat/Component.java +++ b/src/main/java/net/minecraft/network/chat/Component.java @@ -266,6 +266,7 @@ public interface Component extends Message, FormattedText, Iterable { if (!jsonelement.isJsonObject()) { if (jsonelement.isJsonArray()) { JsonArray jsonarray = jsonelement.getAsJsonArray(); + if (jsonarray.size() <= 0) throw new JsonParseException("Unexpected empty array of components"); // Scissors ichatmutablecomponent = null; Iterator iterator = jsonarray.iterator();