Apply NBTReadLimiter to more things.

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2014-07-27 20:46:04 +10:00
parent f972379105
commit 5b20d95920
2 changed files with 52 additions and 0 deletions

View File

@@ -5,3 +5,16 @@
package net.minecraft.nbt;
import java.io.BufferedOutputStream;
@@ -324,6 +325,12 @@
}
public static CompoundTag read(DataInput input, NbtAccounter tracker) throws IOException {
+ // Spigot start
+ if ( input instanceof io.netty.buffer.ByteBufInputStream )
+ {
+ input = new DataInputStream(new org.spigotmc.LimitStream((InputStream) input, tracker));
+ }
+ // Spigot end
Tag nbtbase = NbtIo.readUnnamedTag(input, tracker);
if (nbtbase instanceof CompoundTag) {