From b3698055902c3dddea53f3e03cea791b60ab0e20 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 15 Jan 2012 05:52:46 +0000 Subject: [PATCH] Don't allow players with modded clients to send empty (0 char) chat messages. Thanks to a PR by robin0van0der0v --- src/main/java/net/minecraft/server/NetServerHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 9f98355e30..f0cb509eab 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -724,6 +724,11 @@ public class NetServerHandler extends NetHandler implements ICommandListener { public boolean chat(String s) { if (!this.player.dead) { + if (s.length() == 0) { + a.warning(this.player.name + " tried to send an empty message"); + return false; + } + if (s.startsWith("/")) { this.handleCommand(s); return true;