2016-02-29 21:33:06 +00:00
|
|
|
From 8fb434691394ab4b9de38a4c61ecb5f5717a3449 Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46:54 +00: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
|
2015-05-09 20:23:26 +00:00
|
|
|
index c6b5f70..13e9d0b 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java
|
2015-05-09 20:23:26 +00:00
|
|
|
@@ -23,6 +23,7 @@ public class NBTTagByteArray extends NBTBase {
|
2015-02-28 11:36:22 +00:00
|
|
|
void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException {
|
2015-05-09 20:23:26 +00:00
|
|
|
nbtreadlimiter.a(192L);
|
2014-07-21 20:46:54 +00:00
|
|
|
int j = datainput.readInt();
|
2014-11-28 01:17:45 +00:00
|
|
|
+ com.google.common.base.Preconditions.checkArgument( j < 1 << 24);
|
2014-07-21 20:46:54 +00:00
|
|
|
|
|
|
|
nbtreadlimiter.a((long) (8 * j));
|
|
|
|
this.data = new byte[j];
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java
|
2015-05-09 20:23:26 +00:00
|
|
|
index 5f17034..e206e50 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/NBTTagIntArray.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java
|
2015-05-09 20:23:26 +00:00
|
|
|
@@ -27,6 +27,7 @@ public class NBTTagIntArray extends NBTBase {
|
2015-02-28 11:36:22 +00:00
|
|
|
void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException {
|
2015-05-09 20:23:26 +00:00
|
|
|
nbtreadlimiter.a(192L);
|
2014-07-21 20:46:54 +00:00
|
|
|
int j = datainput.readInt();
|
2014-11-28 01:17:45 +00:00
|
|
|
+ com.google.common.base.Preconditions.checkArgument( j < 1 << 24);
|
2014-07-21 20:46:54 +00:00
|
|
|
|
|
|
|
nbtreadlimiter.a((long) (32 * j));
|
|
|
|
this.data = new int[j];
|
|
|
|
--
|
2016-02-29 21:33:06 +00:00
|
|
|
2.5.0
|
2014-07-21 20:46:54 +00:00
|
|
|
|