summaryrefslogtreecommitdiff
path: root/src/mode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mode.cpp')
-rw-r--r--src/mode.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index b4b494340..f23546d75 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -656,6 +656,11 @@ void process_modes(char **parameters,userrec* user,chanrec *chan,int status, int
break;
chan->limit = atoi(parameters[param]);
+
+ // reported by mech: large values cause underflow
+ if (chan->limit < 0)
+ chan->limit = MAXINT;
+
if (chan->limit)
{
strcat(outlist,"l");