Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/CraftBukkit-Patches/0072-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch

34 Zeilen
1.5 KiB
Diff

2015-01-05 04:32:01 +01:00
From 672a4a9a21e9a428fcf80ff56502b438fe505e2e Mon Sep 17 00:00:00 2001
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-11-28 02:17:45 +01:00
index 7525469..7a293eb 100644
--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java
+++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java
2014-11-28 02:17:45 +01:00
@@ -21,6 +21,7 @@ public class NBTTagByteArray extends NBTBase {
2014-11-28 02:17:45 +01:00
void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws java.io.IOException {
int j = datainput.readInt();
2014-11-28 02:17:45 +01:00
+ com.google.common.base.Preconditions.checkArgument( j < 1 << 24);
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
2014-11-28 02:17:45 +01:00
index f331ef3..17b0c3d 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 {
2014-11-28 02:17:45 +01:00
void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws java.io.IOException {
int j = datainput.readInt();
2014-11-28 02:17:45 +01:00
+ com.google.common.base.Preconditions.checkArgument( j < 1 << 24);
nbtreadlimiter.a((long) (32 * j));
this.data = new int[j];
--
2014-11-28 02:17:45 +01:00
2.1.0