mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-14 19:34:54 -05:00
Fix component extra empty array exploit (#82)
This commit is contained in:
parent
08930195bb
commit
ae17467c1b
1 changed files with 22 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
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 534f1e6092d2b64b6e6e3182eac0cc38718ab2f8..7fcab29427ea030c0d9dcb6ce237b67d98420b55 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/Component.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/Component.java
|
||||
@@ -322,6 +322,11 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
|
||||
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();
|
Loading…
Reference in a new issue