diff options
author | linuxdaemon <linuxdaemon@users.noreply.github.com> | 2018-12-21 12:37:22 -0600 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-12-21 19:37:22 +0100 |
commit | 7530285740c2db1bc4457859b0d5f2436e0ed113 (patch) | |
tree | 89635613725a1b7ad6e262d7e3035a518d42e8d2 /src/configparser.cpp | |
parent | 60ae49b62a371791ebbd9e4b131e33b857873f06 (diff) |
Only parse valid durations, don't treat invalid multipliers as seconds (#1538)
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r-- | src/configparser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index e4bf4bd71..abdf6f3de 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -609,14 +609,14 @@ unsigned long ConfigTag::getDuration(const std::string& key, unsigned long def, if (!readString(key, duration)) return def; - if (!InspIRCd::IsValidDuration(duration)) + unsigned long ret; + if (!InspIRCd::Duration(duration, ret)) { 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; } |