summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-11-24 23:27:49 +0000
committerPeter Powell <petpow@saberuk.com>2018-11-24 23:27:49 +0000
commit0d4138631c4f259394e175c9a68257bb16ca4502 (patch)
treec5a238b4a01786cede2a685412989fe32ecff6d4
parentcc5aff3e5a7d83eb0154faf1540fc74959a6f0e5 (diff)
Use the default if an invalid duration is found in getDuration.
-rw-r--r--src/configparser.cpp7
1 files changed, 7 insertions, 0 deletions
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;