From 8f2da2ca93567a733beedaf3122b7c682e5c2ae1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 20 Jan 2014 15:42:52 +1100 Subject: [PATCH] Check j, not i --- ...tch-stalling-on-corrupted-map-data-NBT-arrays.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CraftBukkit-Patches/0097-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch b/CraftBukkit-Patches/0097-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch index 9acded7db..20e52173c 100644 --- a/CraftBukkit-Patches/0097-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch +++ b/CraftBukkit-Patches/0097-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch @@ -1,30 +1,30 @@ -From 51cc9fc818ece90ca3349895c2d8d7d7f210b99e Mon Sep 17 00:00:00 2001 +From 4936e7a8d5a37a5dad22e681ce538a90e9d53685 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 20 Jan 2014 13:44:07 +1100 Subject: [PATCH] Catch stalling on corrupted map data / NBT arrays. diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java -index 916d935..3fa9c1a 100644 +index 916d935..c2e81cb 100644 --- a/src/main/java/net/minecraft/server/NBTTagByteArray.java +++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java @@ -22,6 +22,7 @@ public class NBTTagByteArray extends NBTBase { void load(DataInput datainput, int i) throws IOException { int j = datainput.readInt(); -+ com.google.common.base.Preconditions.checkArgument( i < 1 << 24); ++ com.google.common.base.Preconditions.checkArgument( j < 1 << 24); this.data = new byte[j]; datainput.readFully(this.data); diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java -index 49b3f14..6c33462 100644 +index 49b3f14..4d6a9da 100644 --- a/src/main/java/net/minecraft/server/NBTTagIntArray.java +++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java @@ -25,6 +25,7 @@ public class NBTTagIntArray extends NBTBase { void load(DataInput datainput, int i) throws IOException { int j = datainput.readInt(); -+ com.google.common.base.Preconditions.checkArgument( i < 1 << 24); ++ com.google.common.base.Preconditions.checkArgument( j < 1 << 24); this.data = new int[j];