diff options
| author | 2018-12-21 12:37:22 -0600 | |
|---|---|---|
| committer | 2018-12-21 19:37:22 +0100 | |
| commit | 7530285740c2db1bc4457859b0d5f2436e0ed113 (patch) | |
| tree | 89635613725a1b7ad6e262d7e3035a518d42e8d2 /src/modules/m_repeat.cpp | |
| parent | Fix thinking that 1202 protocol servers have not finished bursting. (diff) | |
| download | inspircd++-7530285740c2db1bc4457859b0d5f2436e0ed113.tar.gz inspircd++-7530285740c2db1bc4457859b0d5f2436e0ed113.tar.bz2 inspircd++-7530285740c2db1bc4457859b0d5f2436e0ed113.zip | |
Only parse valid durations, don't treat invalid multipliers as seconds (#1538)
Diffstat (limited to 'src/modules/m_repeat.cpp')
| -rw-r--r-- | src/modules/m_repeat.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp index bd4206166..a8dd49e2d 100644 --- a/src/modules/m_repeat.cpp +++ b/src/modules/m_repeat.cpp @@ -34,7 +34,7 @@ class ChannelSettings unsigned int Backlog; unsigned int Lines; unsigned int Diff; - unsigned int Seconds; + unsigned long Seconds; void serialize(std::string& out) const { @@ -277,7 +277,10 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> > if ((settings.Lines = ConvToNum<unsigned int>(item)) == 0) return false; - if ((!stream.GetToken(item)) || ((settings.Seconds = InspIRCd::Duration(item)) == 0)) + if (!InspIRCd::Duration(item, settings.Seconds)) + return false; + + if ((!stream.GetToken(item)) || (settings.Seconds == 0)) // Required parameter missing return false; |
