2014-01-22 09:19:39 +01:00
|
|
|
From 83f40b07823892893854db7993dddb1ab5b24719 Mon Sep 17 00:00:00 2001
|
2014-01-20 03:44:41 +01:00
|
|
|
From: md_5 <git@md-5.net>
|
|
|
|
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
|
2014-01-20 05:42:52 +01:00
|
|
|
index 916d935..c2e81cb 100644
|
2014-01-20 03:44:41 +01:00
|
|
|
--- 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();
|
2014-01-20 05:42:52 +01:00
|
|
|
+ com.google.common.base.Preconditions.checkArgument( j < 1 << 24);
|
2014-01-20 03:44:41 +01:00
|
|
|
|
|
|
|
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
|
2014-01-20 05:42:52 +01:00
|
|
|
index 49b3f14..4d6a9da 100644
|
2014-01-20 03:44:41 +01:00
|
|
|
--- 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();
|
2014-01-20 05:42:52 +01:00
|
|
|
+ com.google.common.base.Preconditions.checkArgument( j < 1 << 24);
|
2014-01-20 03:44:41 +01:00
|
|
|
|
|
|
|
this.data = new int[j];
|
|
|
|
|
|
|
|
--
|
|
|
|
1.8.3.2
|
|
|
|
|