From 534d546002f4d58df5920af003437a42a051434c Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Tue, 12 Apr 2011 22:03:43 -0400 Subject: [PATCH] Fixed a crash involving invalid positions. --- .../java/net/minecraft/server/NetServerHandler.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index d60d4b4988..fd22945f1c 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) {