From 4cc6854a6771befda9d5ac1e007e97b29b48e80b Mon Sep 17 00:00:00 2001 From: Benjamin James Harrison-Sims Date: Sun, 14 Apr 2013 03:09:29 +0100 Subject: [PATCH] Prevent handshake spam from invalid names. --- ...nt-handshake-spam-from-invalid-names.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CraftBukkit-Patches/0039-Prevent-handshake-spam-from-invalid-names.patch diff --git a/CraftBukkit-Patches/0039-Prevent-handshake-spam-from-invalid-names.patch b/CraftBukkit-Patches/0039-Prevent-handshake-spam-from-invalid-names.patch new file mode 100644 index 000000000..ce73c1385 --- /dev/null +++ b/CraftBukkit-Patches/0039-Prevent-handshake-spam-from-invalid-names.patch @@ -0,0 +1,21 @@ +From f22c9b13df956663f41d000bea443a737624b91c Mon Sep 17 00:00:00 2001 +From: Benjamin James Harrison-Sims +Date: Sun, 14 Apr 2013 03:08:51 +0100 +Subject: [PATCH] Prevent handshake spam from invalid names. + + +diff --git a/src/main/java/net/minecraft/server/Packet2Handshake.java b/src/main/java/net/minecraft/server/Packet2Handshake.java +index 343af93..920e045 100644 +--- a/src/main/java/net/minecraft/server/Packet2Handshake.java ++++ b/src/main/java/net/minecraft/server/Packet2Handshake.java +@@ -19,6 +19,7 @@ public class Packet2Handshake extends Packet { + this.b = a(datainputstream, 16); + this.c = a(datainputstream, 255); + this.d = datainputstream.readInt(); ++ if(!this.b.matches("^[a-zA-Z0-9_]{3,16}$")){throw new IOException("Invalid name!");}// Spigot + } + + public void a(DataOutputStream dataoutputstream) throws IOException { // CraftBukkit - throws IOException +-- +1.8.2.1 +