From 4ec37f1d2bf21f2edddec15e6d7c5570b37be214 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Fri, 5 Sep 2014 15:37:49 +0200 Subject: [PATCH] cmode_l Reject negative limits --- src/modes/cmode_l.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.39.5