From 4e0cb28c1913c4ef76dd06b04fe321afe310f232 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 12 Dec 2018 20:59:19 +0000 Subject: Fix not rejecting invalid durations in DCCALLOW. --- src/modules/m_dccallow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/modules') 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 { -- cgit v1.2.3