summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordz <dz@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-29 16:01:53 +0000
committerdz <dz@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-29 16:01:53 +0000
commit0a3c36b49eee49a4ac865202c9b68752c9b962a7 (patch)
tree01670b55ba198887f47da67bb8043bc7db27d5bf /src
parent408d516f781b77f66929ce3e5ca58b88888b1ede (diff)
send ERR_NEEDMOREPARAMS if an empty parameter is given to STATS ('STATS :'), fixes bug #813 reported by Kazuma.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11271 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/commands/cmd_stats.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/commands/cmd_stats.cpp b/src/commands/cmd_stats.cpp
index b664dd191..09a6c4394 100644
--- a/src/commands/cmd_stats.cpp
+++ b/src/commands/cmd_stats.cpp
@@ -39,7 +39,12 @@ CmdResult CommandStats::Handle (const std::vector<std::string>& parameters, User
if (IS_LOCAL(user))
{
string_list values;
- char search = parameters[0].length() ? parameters[0][0] : 0;
+ if (parameters[0].empty())
+ {
+ user->WriteNumeric(ERR_NEEDMOREPARAMS, "%s STATS :Not enough parameters.", user->nick.c_str());
+ return CMD_FAILURE;
+ }
+ char search = parameters[0][0];
DoStats(this->ServerInstance, search, user, values);
for (size_t i = 0; i < values.size(); i++)
user->Write(":%s", values[i].c_str());