summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-07-23 15:17:01 +0100
committerPeter Powell <petpow@saberuk.com>2019-07-23 15:17:01 +0100
commitabdc47a61538231ad1d5e077cf2a84f414c87454 (patch)
tree0d1b9dc2951e5fb54d282b68a82e1f584dd2807a /src
parent438a088b5176068c753aebe860e2d89fefe09eb4 (diff)
Add a constant for the maximum length of a mode parameter.
Diffstat (limited to 'src')
-rw-r--r--src/listmode.cpp3
-rw-r--r--src/mode.cpp6
-rw-r--r--src/modules/m_chanfilter.cpp2
3 files changed, 4 insertions, 7 deletions
diff --git a/src/listmode.cpp b/src/listmode.cpp
index 3d8221779..2a2515cd2 100644
--- a/src/listmode.cpp
+++ b/src/listmode.cpp
@@ -160,9 +160,6 @@ ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, std
if (tidy)
ModeParser::CleanMask(parameter);
- if (parameter.length() > 250)
- return MODEACTION_DENY;
-
// If there was no list
if (!cd)
{
diff --git a/src/mode.cpp b/src/mode.cpp
index 159474985..8b0d88607 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -249,9 +249,9 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, Mode
const bool needs_param = mh->NeedsParam(adding);
std::string& parameter = mcitem.param;
- // crop mode parameter size to 250 characters
- if (parameter.length() > 250 && adding)
- parameter.erase(250);
+ // crop mode parameter size to MODE_PARAM_MAX characters
+ if (parameter.length() > MODE_PARAM_MAX && adding)
+ parameter.erase(MODE_PARAM_MAX);
ModResult MOD_RESULT;
FIRST_MOD_RESULT(OnRawMode, MOD_RESULT, (user, chan, mh, parameter, adding));
diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp
index b2323176c..6131ab916 100644
--- a/src/modules/m_chanfilter.cpp
+++ b/src/modules/m_chanfilter.cpp
@@ -71,7 +71,7 @@ class ModuleChanFilter : public Module
{
ConfigTag* tag = ServerInstance->Config->ConfValue("chanfilter");
hidemask = tag->getBool("hidemask");
- cf.maxlen = tag->getUInt("maxlen", 35, 10, 100);
+ cf.maxlen = tag->getUInt("maxlen", 35, 10, ModeParser::MODE_PARAM_MAX);
notifyuser = tag->getBool("notifyuser", true);
cf.DoRehash();
}