SPIGOT-705: Fix possible CME

By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
CraftBukkit/Spigot
2015-03-15 21:38:05 +00:00
parent 1434cff8a2
commit 605de3306b
3 changed files with 39 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/Chunk.java 2015-02-26 22:40:22.311608142 +0000
+++ src/main/java/net/minecraft/server/Chunk.java 2015-02-26 22:40:22.315608142 +0000
--- /home/matt/mc-dev-private//net/minecraft/server/Chunk.java 2015-03-15 21:30:40.204367362 +0000
+++ src/main/java/net/minecraft/server/Chunk.java 2015-03-15 21:30:40.216367361 +0000
@@ -14,6 +14,9 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -63,7 +63,15 @@
public Chunk(World world, int i, int j) {
this.sections = new ChunkSection[16];
this.e = new byte[256];
@@ -60,8 +91,17 @@
@@ -54,14 +85,25 @@
this.locZ = j;
this.heightMap = new int[256];
+ /* CraftBukkit start
for (int k = 0; k < this.entitySlices.length; ++k) {
this.entitySlices[k] = new EntitySlice(Entity.class);
}
+ // CraftBukkit end */
Arrays.fill(this.f, -999);
Arrays.fill(this.e, (byte) -1);
@@ -81,7 +89,7 @@
public Chunk(World world, ChunkSnapshot chunksnapshot, int i, int j) {
this(world, i, j);
short short0 = 256;
@@ -529,7 +569,8 @@
@@ -529,7 +571,8 @@
}
}
@@ -91,7 +99,7 @@
block.onPlace(this.world, blockposition, iblockdata);
}
@@ -610,7 +651,11 @@
@@ -610,7 +653,11 @@
int j = MathHelper.floor(entity.locZ / 16.0D);
if (i != this.locX || j != this.locZ) {
@@ -104,7 +112,7 @@
entity.die();
}
@@ -697,6 +742,13 @@
@@ -697,6 +744,13 @@
tileentity.D();
this.tileEntities.put(blockposition, tileentity);
@@ -118,7 +126,7 @@
}
}
@@ -740,7 +792,21 @@
@@ -740,7 +794,21 @@
}
for (int i = 0; i < this.entitySlices.length; ++i) {
@@ -141,7 +149,7 @@
}
}
@@ -798,8 +864,8 @@
@@ -798,8 +866,8 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();