summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-03-09 18:23:20 +0100
committerErik Broes <erikbroes@grum.nl>2011-03-09 18:31:45 +0100
commit454da93a00ef7e9f44cb0184a0d94387ccdd6b01 (patch)
tree0d3303a10df1491b6675d7bc632a512fc26ee331 /src/main/java/net
parentf056fad7657a7d2dd6cbb6379cc3492ea7b08244 (diff)
downloadcraftbukkit-454da93a00ef7e9f44cb0184a0d94387ccdd6b01.tar
craftbukkit-454da93a00ef7e9f44cb0184a0d94387ccdd6b01.tar.gz
craftbukkit-454da93a00ef7e9f44cb0184a0d94387ccdd6b01.tar.lz
craftbukkit-454da93a00ef7e9f44cb0184a0d94387ccdd6b01.tar.xz
craftbukkit-454da93a00ef7e9f44cb0184a0d94387ccdd6b01.zip
Record invalid ItemInHandIndex packet
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/NetServerHandler.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java
index 75e63067..0e51c54a 100644
--- a/src/main/java/net/minecraft/server/NetServerHandler.java
+++ b/src/main/java/net/minecraft/server/NetServerHandler.java
@@ -549,6 +549,16 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
}
public void a(Packet16BlockItemSwitch packet16blockitemswitch) {
+ if (packet16blockitemswitch.a < 0 || packet16blockitemswitch.a > 8) {
+ server.getLogger().severe(
+ "Player " + getPlayer().getName() + "/" + getPlayer().getAddress().toString() +
+ " just send an invalid ItemInHandIndex: " + packet16blockitemswitch.a +
+ " - very likely a crashing exploit attempt. Recommend ban, and sending a package of joy their way."
+ );
+ this.d.f.a(new Packet1Login("", "", 0, 0, (byte)0));
+ return;
+ }
+
// CraftBukkit start
PlayerItemHeldEvent event = new PlayerItemHeldEvent(Type.PLAYER_ITEM_HELD, getPlayer(), e.inventory.c, packet16blockitemswitch.a);
server.getPluginManager().callEvent(event);