summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-07-07 13:40:30 +0200
committerattilamolnar <attilamolnar@hush.com>2012-07-07 13:40:30 +0200
commit3ac4e6956d4ec4c976aef19772b65e7108d6315a (patch)
tree1b38fff98926f524a20ace937d751f8e419223ba /src/modules
parentf1094b52ae429f0e2880f3bbd4f1c6bfe22bb326 (diff)
m_setname, m_chgname Disallow empty GECOS, spotted by @Robby-
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_chgname.cpp6
-rw-r--r--src/modules/m_setname.cpp3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp
index 194ecf80e..667ddd928 100644
--- a/src/modules/m_chgname.cpp
+++ b/src/modules/m_chgname.cpp
@@ -44,6 +44,12 @@ class CommandChgname : public Command
return CMD_FAILURE;
}
+ if (parameters[1].empty())
+ {
+ user->WriteServ("NOTICE %s :*** CHGNAME: GECOS must be specified", user->nick.c_str());
+ return CMD_FAILURE;
+ }
+
if (parameters[1].length() > ServerInstance->Config->Limits.MaxGecos)
{
user->WriteServ("NOTICE %s :*** GECOS too long", user->nick.c_str());
diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp
index 0d6b1d9f3..3b8d4d149 100644
--- a/src/modules/m_setname.cpp
+++ b/src/modules/m_setname.cpp
@@ -36,7 +36,7 @@ class CommandSetname : public Command
CmdResult Handle (const std::vector<std::string>& parameters, User *user)
{
- if (parameters.size() == 0)
+ if (parameters[0].empty())
{
user->WriteServ("NOTICE %s :*** SETNAME: GECOS must be specified", user->nick.c_str());
return CMD_FAILURE;
@@ -51,7 +51,6 @@ class CommandSetname : public Command
if (user->ChangeName(parameters[0].c_str()))
{
ServerInstance->SNO->WriteGlobalSno('a', "%s used SETNAME to change their GECOS to %s", user->nick.c_str(), parameters[0].c_str());
- return CMD_SUCCESS;
}
return CMD_SUCCESS;