summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/command_parse.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 76dfc06ce..53f19437b 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -193,8 +193,12 @@ bool CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
* the rfc says they shouldnt but also says the ircd should
* discard it if they do.
*/
- if (command[0] == ':')
- tokens.GetToken(command);
+ if ((command.empty() || command[0] == ':') && !tokens.GetToken(command))
+ {
+ // Penalise the user to discourage them from spamming the server with trash.
+ user->CommandFloodPenalty += 2000;
+ return false;
+ }
while (tokens.GetToken(token) && (command_p.size() <= MAXPARAMETERS))
command_p.push_back(token);