diff options
author | EvilSeph <evilseph@unaligned.org> | 2011-04-12 22:03:43 -0400 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-04-12 22:03:54 -0400 |
commit | 534d546002f4d58df5920af003437a42a051434c (patch) | |
tree | 26f357051e5e8e89c3ed1e7be78d1fca3cb3ec03 /src/main/java | |
parent | 7baf5fa4849b969856ceae6cdcff70eed3e893ed (diff) | |
download | craftbukkit-534d546002f4d58df5920af003437a42a051434c.tar craftbukkit-534d546002f4d58df5920af003437a42a051434c.tar.gz craftbukkit-534d546002f4d58df5920af003437a42a051434c.tar.lz craftbukkit-534d546002f4d58df5920af003437a42a051434c.tar.xz craftbukkit-534d546002f4d58df5920af003437a42a051434c.zip |
Fixed a crash involving invalid positions.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index d60d4b49..fd22945f 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -143,6 +143,18 @@ public class NetServerHandler extends NetHandler implements ICommandListener { this.lastYaw = this.e.yaw; this.lastPitch = this.e.pitch; } + + if (Math.abs(packet10flying.a) > 32000000 || Math.abs(packet10flying.c) > 32000000) { + System.err.println(player.getName() + " was caught trying to crash the server with an invalid position."); + player.kickPlayer("Nope!"); + return; + } + + if (Math.abs(packet10flying.c) > 32000000) { + System.err.println(player.getName() + " was caught trying to crash the server with an invalid position."); + player.kickPlayer("Nope!"); + return; + } // CraftBukkit end if (this.l) { |