diff options
author | Daniel De Graaf <danieldg@inspircd.org> | 2012-02-25 23:41:04 -0500 |
---|---|---|
committer | Daniel De Graaf <danieldg@inspircd.org> | 2012-02-25 23:41:04 -0500 |
commit | a673d973807c81c6211b39cc046de5af53c4bd99 (patch) | |
tree | 75dfc9207dd548a3ba8d5403b6a9059ee02f9d76 /src/modules | |
parent | b2331d74585aa59f35341a526685a1739cf9d40e (diff) |
m_chghost: Fix incorrect length check pointed out by Thales
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_chghost.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 8c3911418..0262a5f37 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -33,6 +33,12 @@ class CommandChghost : public Command { const char* x = parameters[1].c_str(); + if (parameters[1].length() > 63) + { + user->WriteServ("NOTICE %s :*** CHGHOST: Host too long", user->nick.c_str()); + return CMD_FAILURE; + } + for (; *x; x++) { if (!hostmap[(unsigned char)*x]) @@ -42,11 +48,6 @@ class CommandChghost : public Command } } - if ((parameters[1].c_str() - x) > 63) - { - user->WriteServ("NOTICE %s :*** CHGHOST: Host too long", user->nick.c_str()); - return CMD_FAILURE; - } User* dest = ServerInstance->FindNick(parameters[0]); if (!dest) |