summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modes/cmode_l.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modes/cmode_l.cpp b/src/modes/cmode_l.cpp
index 9121d64ec..d61b2597b 100644
--- a/src/modes/cmode_l.cpp
+++ b/src/modes/cmode_l.cpp
@@ -35,7 +35,11 @@ bool ModeChannelLimit::ResolveModeConflict(std::string &their_param, const std::
ModeAction ModeChannelLimit::OnSet(User* user, Channel* chan, std::string& parameter)
{
- ext.set(chan, ConvToInt(parameter));
+ int limit = ConvToInt(parameter);
+ if (limit < 0)
+ return MODEACTION_DENY;
+
+ ext.set(chan, limit);
return MODEACTION_ALLOW;
}