diff --git a/paper-server/patches/sources/net/minecraft/nbt/ByteArrayTag.java.patch b/paper-server/patches/sources/net/minecraft/nbt/ByteArrayTag.java.patch index 8425cde14a..d7c707925b 100644 --- a/paper-server/patches/sources/net/minecraft/nbt/ByteArrayTag.java.patch +++ b/paper-server/patches/sources/net/minecraft/nbt/ByteArrayTag.java.patch @@ -5,3 +5,11 @@ package net.minecraft.nbt; import java.io.DataInput; +@@ -24,6 +25,7 @@ + private static byte[] readAccounted(DataInput input, NbtAccounter tracker) throws IOException { + tracker.accountBytes(24L); + int i = input.readInt(); ++ com.google.common.base.Preconditions.checkArgument( i < 1 << 24); // Spigot + + tracker.accountBytes(1L, (long) i); + byte[] abyte = new byte[i]; diff --git a/paper-server/patches/sources/net/minecraft/nbt/IntArrayTag.java.patch b/paper-server/patches/sources/net/minecraft/nbt/IntArrayTag.java.patch index 84a9ce8372..97872e3339 100644 --- a/paper-server/patches/sources/net/minecraft/nbt/IntArrayTag.java.patch +++ b/paper-server/patches/sources/net/minecraft/nbt/IntArrayTag.java.patch @@ -5,3 +5,11 @@ package net.minecraft.nbt; import java.io.DataInput; +@@ -24,6 +25,7 @@ + private static int[] readAccounted(DataInput input, NbtAccounter tracker) throws IOException { + tracker.accountBytes(24L); + int i = input.readInt(); ++ com.google.common.base.Preconditions.checkArgument( i < 1 << 24); // Spigot + + tracker.accountBytes(4L, (long) i); + int[] aint = new int[i];