2023-05-29 22:59:58 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Luna <lunahatesgogle@gmail.com>
|
|
|
|
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
|
2023-05-31 23:18:11 +00:00
|
|
|
index 3c0ee4e1f42f6056ca86a6f9f129d467e29a2fbc..9c2c22ee548ad77f0912698f33de5f467f32fb7f 100644
|
2023-05-29 22:59:58 +00:00
|
|
|
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
|
|
|
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
2023-05-31 23:18:11 +00:00
|
|
|
@@ -266,6 +266,11 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
2023-05-29 22:59:58 +00:00
|
|
|
if (!jsonelement.isJsonObject()) {
|
|
|
|
if (jsonelement.isJsonArray()) {
|
|
|
|
JsonArray jsonarray = jsonelement.getAsJsonArray();
|
|
|
|
+ // Scissors start
|
|
|
|
+ if (jsonarray.size() <= 0) {
|
|
|
|
+ throw new JsonParseException("Unexpected empty array of components");
|
|
|
|
+ }
|
|
|
|
+ // Scissors end
|
|
|
|
|
|
|
|
ichatmutablecomponent = null;
|
|
|
|
Iterator iterator = jsonarray.iterator();
|