summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-11-30 18:40:10 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-11-30 18:40:10 +0100
commit7559c4316830b24c338096b96384d35877794125 (patch)
tree25d846a0c8e671f82904a8fe9b872f9a7bdfd5a2
parentc5f19db85c2a2669884eb8ac72362c86afb65617 (diff)
Reject empty mode parameters in ModeParser::Process() instead of relying on ModeHandlers to do it
-rw-r--r--src/mode.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 2a32dfac2..89ff37fa1 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -470,7 +470,7 @@ void ModeParser::Process(const std::vector<std::string>& parameters, User *user,
{
parameter = parameters[param_at++];
/* Make sure the user isn't trying to slip in an invalid parameter */
- if ((parameter.find(':') == 0) || (parameter.rfind(' ') != std::string::npos))
+ if ((parameter.empty()) || (parameter.find(':') == 0) || (parameter.rfind(' ') != std::string::npos))
continue;
if (merge && targetchannel && targetchannel->IsModeSet(modechar) && !mh->IsListMode())
{