diff options
author | Sadie Powell <sadie@witchery.services> | 2020-09-30 17:21:52 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-09-30 17:21:52 +0100 |
commit | 5c06a0f3351f187e737e99d1f1ddaac267284377 (patch) | |
tree | f85a6a69f857cee6b556fc9521540a9131cbfc56 /src | |
parent | 49a165ef13cbe41dd7ed73e53a97437735868046 (diff) |
Check that the values specified in <limits> are reasonable.
Diffstat (limited to 'src')
-rw-r--r-- | src/configreader.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 68630685f..d06753423 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -38,17 +38,17 @@ #include <iostream> ServerLimits::ServerLimits(ConfigTag* tag) - : NickMax(tag->getUInt("maxnick", 30)) - , ChanMax(tag->getUInt("maxchan", 64)) - , MaxModes(tag->getUInt("maxmodes", 20)) - , IdentMax(tag->getUInt("maxident", 10)) - , MaxQuit(tag->getUInt("maxquit", 255)) - , MaxTopic(tag->getUInt("maxtopic", 307)) - , MaxKick(tag->getUInt("maxkick", 255)) - , MaxReal(tag->getUInt("maxreal", tag->getUInt("maxgecos", 128))) - , MaxAway(tag->getUInt("maxaway", 200)) - , MaxLine(tag->getUInt("maxline", 512)) - , MaxHost(tag->getUInt("maxhost", 64)) + : MaxLine(tag->getUInt("maxline", 512, 512)) + , NickMax(tag->getUInt("maxnick", 30, 1, MaxLine)) + , ChanMax(tag->getUInt("maxchan", 64, 1, MaxLine)) + , MaxModes(tag->getUInt("maxmodes", 20, 1)) + , IdentMax(tag->getUInt("maxident", 10, 1)) + , MaxQuit(tag->getUInt("maxquit", 255, 0, MaxLine)) + , MaxTopic(tag->getUInt("maxtopic", 307, 1, MaxLine)) + , MaxKick(tag->getUInt("maxkick", 255, 1, MaxLine)) + , MaxReal(tag->getUInt("maxreal", tag->getUInt("maxgecos", 128), 1, MaxLine)) + , MaxAway(tag->getUInt("maxaway", 200, 1, MaxLine)) + , MaxHost(tag->getUInt("maxhost", 64, 1, MaxLine)) { } |