Scissors/patches/server/0043-Fix-component-extra-empty-array-exploit.patch
Luna 3f889f5040
Slime (#136)
* Slime

* Add proper credits. Thanks ASP!

* Cleanup
2023-08-22 19:15:48 -05:00

19 lines
1.1 KiB
Diff

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
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<Component> {
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();