diff options
author | Peter Powell <petpow@saberuk.com> | 2018-12-12 20:59:19 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-12-12 21:39:46 +0000 |
commit | 4e0cb28c1913c4ef76dd06b04fe321afe310f232 (patch) | |
tree | 171116646c864ec9af9153b3334f16876efb7874 | |
parent | 654355c2d114a68639ac36238291ebfceec2537d (diff) |
Fix not rejecting invalid durations in DCCALLOW.
-rw-r--r-- | src/modules/m_dccallow.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index f2d6bf105..eb364089a 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -213,9 +213,10 @@ class CommandDccallow : public Command { length = InspIRCd::Duration(default_length); } - else if (!atoi(parameters[1].c_str())) + else if (!InspIRCd::IsValidDuration(parameters[1])) { - length = 0; + user->WriteNumeric(ERR_DCCALLOWINVALID, user->nick, InspIRCd::Format("%s is not a valid DCCALLOW duration", parameters[1].c_str())); + return CMD_FAILURE; } else { |