summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-26 06:15:14 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-26 06:15:14 +0000
commitee6208dc8f5bb806eca36e230ca5bbb6d5a45f60 (patch)
tree8302f402166ca2bbb7ae724042c129d1fcaa75bf /src/modules
parent97590f92393a62af0847728132970c38e334b687 (diff)
Added checks for empty ident/host/gecos in the chg* and set* commands. Patch by Stskeeps
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7412 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_chghost.cpp6
-rw-r--r--src/modules/m_chgident.cpp5
-rw-r--r--src/modules/m_chgname.cpp6
-rw-r--r--src/modules/m_sethost.cpp5
-rw-r--r--src/modules/m_setident.cpp5
-rw-r--r--src/modules/m_setname.cpp6
6 files changed, 32 insertions, 1 deletions
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp
index c5e114575..d914fd2a2 100644
--- a/src/modules/m_chghost.cpp
+++ b/src/modules/m_chghost.cpp
@@ -43,6 +43,12 @@ class cmd_chghost : public command_t
return CMD_FAILURE;
}
}
+ if (!*parameters[0])
+ {
+ user->WriteServ("NOTICE %s :*** CHGHOST: Host must be specified", user->nick);
+ return CMD_FAILURE;
+ }
+
if ((parameters[1] - x) > 63)
{
user->WriteServ("NOTICE %s :*** CHGHOST: Host too long",user->nick);
diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp
index 21107f124..e3067fe56 100644
--- a/src/modules/m_chgident.cpp
+++ b/src/modules/m_chgident.cpp
@@ -38,6 +38,11 @@ class cmd_chgident : public command_t
return CMD_FAILURE;
}
+ if (!*parameters[1])
+ {
+ user->WriteServ("NOTICE %s :*** CHGIDENT: Needs non-zero length ident", user->nick);
+ return CMD_FAILURE;
+ }
if(!ServerInstance->IsIdent(parameters[1]))
{
user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp
index 2e1171526..f3ea9cc25 100644
--- a/src/modules/m_chgname.cpp
+++ b/src/modules/m_chgname.cpp
@@ -37,7 +37,11 @@ class cmd_chgname : public command_t
user->WriteServ("401 %s %s :No such nick/channel", user->nick, parameters[0]);
return CMD_FAILURE;
}
-
+ if (!*parameters[1])
+ {
+ user->WriteServ("NOTICE %s :*** GECOS is too short", user->nick);
+ return CMD_FAILURE;
+ }
if (IS_LOCAL(dest))
{
dest->ChangeName(parameters[1]);
diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp
index 490b63016..0719bd648 100644
--- a/src/modules/m_sethost.cpp
+++ b/src/modules/m_sethost.cpp
@@ -42,6 +42,11 @@ class cmd_sethost : public command_t
return CMD_FAILURE;
}
}
+ if (len == 0)
+ {
+ user->WriteServ("NOTICE %s :*** SETHOST: Host too short", user->nick);
+ return CMD_FAILURE;
+ }
if (len > 64)
{
user->WriteServ("NOTICE %s :*** SETHOST: Host too long",user->nick);
diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp
index 4bd19fd7a..a98592299 100644
--- a/src/modules/m_setident.cpp
+++ b/src/modules/m_setident.cpp
@@ -39,6 +39,11 @@ class cmd_setident : public command_t
user->WriteServ("NOTICE %s :*** Invalid characters in ident", user->nick);
return CMD_FAILURE;
}
+ if (len == 0)
+ {
+ user->WriteServ("NOTICE %s :*** SETIDENT: Ident too short", user->nick);
+ return CMD_FAILURE;
+ }
if (len > IDENTMAX)
{
user->WriteServ("NOTICE %s :*** Ident is too long", user->nick);
diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp
index 8804f185d..3ececbbb3 100644
--- a/src/modules/m_setname.cpp
+++ b/src/modules/m_setname.cpp
@@ -36,7 +36,13 @@ class cmd_setname : public command_t
{
line = line + std::string(parameters[i]) + " ";
}
+
line = line + std::string(parameters[pcnt-1]);
+ if (line.length() == 0)
+ {
+ user->WriteServ("NOTICE %s :*** GECOS too short", user->nick);
+ return CMD_FAILURE;
+ }
user->ChangeName(line.c_str());
return CMD_SUCCESS;