summaryrefslogtreecommitdiff
path: root/src/modules/m_sethost.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-08-13 08:52:39 +0100
committerPeter Powell <petpow@saberuk.com>2017-08-16 17:21:16 +0100
commit346f47c26a0ace1c922d2a240e0013b9085479c1 (patch)
treeb6491788c8e1206745a2bbd14518b883ae0063a5 /src/modules/m_sethost.cpp
parent3fbc05242c87fee6a401b94877f7eda865d672bc (diff)
m_sethost: check the length first for consistency with CHGHOST.
Diffstat (limited to 'src/modules/m_sethost.cpp')
-rw-r--r--src/modules/m_sethost.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp
index a5f36da65..e2a5dc281 100644
--- a/src/modules/m_sethost.cpp
+++ b/src/modules/m_sethost.cpp
@@ -36,6 +36,12 @@ class CommandSethost : public Command
CmdResult Handle (const std::vector<std::string>& parameters, User *user)
{
+ if (parameters[0].length() > ServerInstance->Config->Limits.MaxHost)
+ {
+ user->WriteNotice("*** SETHOST: Host too long");
+ return CMD_FAILURE;
+ }
+
for (std::string::const_iterator x = parameters[0].begin(); x != parameters[0].end(); x++)
{
if (!hostmap[(const unsigned char)*x])
@@ -45,12 +51,6 @@ class CommandSethost : public Command
}
}
- if (parameters[0].length() > ServerInstance->Config->Limits.MaxHost)
- {
- user->WriteNotice("*** SETHOST: Host too long");
- return CMD_FAILURE;
- }
-
if (user->ChangeDisplayedHost(parameters[0]))
{
ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SETHOST to change their displayed host to "+user->dhost);