MAXMODES wasn't being enforced

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3279 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
brain 2006-02-21 21:37:49 +00:00
parent e5a1541029
commit f508e5fb37

View File

@ -589,6 +589,12 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
{ {
r = NULL; r = NULL;
/* If we have more than MAXMODES changes in one line,
* drop all after the MAXMODES
*/
if (pc > MAXMODES)
break;
{ {
switch (*modechar) switch (*modechar)
{ {
@ -629,6 +635,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
log(DEBUG,"Ops"); log(DEBUG,"Ops");
if ((param >= pcnt)) break; if ((param >= pcnt)) break;
log(DEBUG,"Enough parameters left"); log(DEBUG,"Enough parameters left");
r = NULL;
if (mdir == 1) if (mdir == 1)
{ {
MOD_RESULT = 0; MOD_RESULT = 0;
@ -660,6 +667,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
case 'h': case 'h':
if (((param >= pcnt)) || (!Config->AllowHalfop)) break; if (((param >= pcnt)) || (!Config->AllowHalfop)) break;
r = NULL;
if (mdir == 1) if (mdir == 1)
{ {
MOD_RESULT = 0; MOD_RESULT = 0;
@ -690,6 +698,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
case 'v': case 'v':
if ((param >= pcnt)) break; if ((param >= pcnt)) break;
r = NULL;
if (mdir == 1) if (mdir == 1)
{ {
MOD_RESULT = 0; MOD_RESULT = 0;
@ -719,6 +728,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
case 'b': case 'b':
if ((param >= pcnt)) break; if ((param >= pcnt)) break;
r = NULL;
if (mdir == 1) if (mdir == 1)
{ {
MOD_RESULT = 0; MOD_RESULT = 0;