From 0d4138631c4f259394e175c9a68257bb16ca4502 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 24 Nov 2018 23:27:49 +0000 Subject: Use the default if an invalid duration is found in getDuration. --- src/configparser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/configparser.cpp b/src/configparser.cpp index 437b3cdb0..efcc6c68b 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -535,6 +535,13 @@ unsigned long ConfigTag::getDuration(const std::string& key, unsigned long def, if (!readString(key, duration)) return def; + if (!InspIRCd::IsValidDuration(duration)) + { + ServerInstance->Logs->Log("CONFIG", LOG_DEFAULT, "Value of <" + tag + ":" + key + "> at " + getTagLocation() + + " is not a duration; value set to " + ConvToStr(def) + "."); + return def; + } + unsigned long ret = InspIRCd::Duration(duration); CheckRange(tag, key, ret, def, min, max); return ret; -- cgit v1.2.3