mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-01 12:37:10 +00:00
3f889f5040
* Slime * Add proper credits. Thanks ASP! * Cleanup
19 lines
1.1 KiB
Diff
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();
|