Skip to content

Commit

Permalink
Cap masks and bans at 250 characters
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12575 e03df62e-2008-0410-955e-edbf42e46eb7
  • Loading branch information
danieldg committed Mar 1, 2010
1 parent ed4188c commit 7906b82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/helperfuncs.cpp
Expand Up @@ -173,6 +173,9 @@ bool InspIRCd::IsValidMask(const std::string &mask)
if (exclamation != 1 || atsign != 1)
return false;

if (mask.length() > 250)
return false;

return true;
}

Expand Down
4 changes: 4 additions & 0 deletions src/mode.cpp
Expand Up @@ -265,6 +265,10 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool
ModeHandler *mh = FindMode(modechar, type);
int pcnt = mh->GetNumParams(adding);

// crop mode parameter size to 250 characters
if (parameter.length() > 250)
parameter = parameter.substr(0, 250);

ModResult MOD_RESULT;
FIRST_MOD_RESULT(OnRawMode, MOD_RESULT, (user, chan, modechar, parameter, adding, pcnt));

Expand Down

0 comments on commit 7906b82

Please sign in to comment.