2023-05-29 23:32:04 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Luna <lunahatesgogle@gmail.com>
|
|
|
|
Date: Mon, 29 May 2023 19:47:48 -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-06-01 03:03:10 +00:00
|
|
|
index 6978d14c6bd90ffb640e39e8666430d95d5ef45c..474ed00c09d58a7796cd543c9bcf8752e2f9f742 100644
|
2023-05-29 23:32:04 +00:00
|
|
|
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
|
|
|
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
2023-06-01 03:03:10 +00:00
|
|
|
@@ -201,6 +201,12 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
2023-05-29 23:32:04 +00:00
|
|
|
} else 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
|
|
|
|
+
|
|
|
|
MutableComponent ichatmutablecomponent = null;
|
|
|
|
Iterator iterator = jsonarray.iterator();
|
|
|
|
|