summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-21 21:37:49 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-21 21:37:49 +0000
commitf508e5fb37726b1acc136c3c163e8834ab814bca (patch)
treead031f71a860a5364b3015c6303412f9802d375b
parente5a154102992d8163b0c1e80681b53bc82cce824 (diff)
MAXMODES wasn't being enforced
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3279 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/mode.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 41251918a..b2abd0563 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -589,6 +589,12 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
{
r = NULL;
+ /* If we have more than MAXMODES changes in one line,
+ * drop all after the MAXMODES
+ */
+ if (pc > MAXMODES)
+ break;
+
{
switch (*modechar)
{
@@ -629,6 +635,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
log(DEBUG,"Ops");
if ((param >= pcnt)) break;
log(DEBUG,"Enough parameters left");
+ r = NULL;
if (mdir == 1)
{
MOD_RESULT = 0;
@@ -660,6 +667,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
case 'h':
if (((param >= pcnt)) || (!Config->AllowHalfop)) break;
+ r = NULL;
if (mdir == 1)
{
MOD_RESULT = 0;
@@ -690,6 +698,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
case 'v':
if ((param >= pcnt)) break;
+ r = NULL;
if (mdir == 1)
{
MOD_RESULT = 0;
@@ -719,6 +728,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
case 'b':
if ((param >= pcnt)) break;
+ r = NULL;
if (mdir == 1)
{
MOD_RESULT = 0;