summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/helperfuncs.cpp3
-rw-r--r--src/mode.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 779bc94cc..c5cfdd79a 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -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;
}
diff --git a/src/mode.cpp b/src/mode.cpp
index a632ab516..bda0f81aa 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -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));