diff options
| author | Adam <Adam@anope.org> | 2011-02-19 19:03:05 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-02-19 19:03:05 -0500 |
| commit | f49a3e03c1561cc5e9996a1450881dae50982f98 (patch) | |
| tree | 356a381670302dcad347de26b1626b8a83330851 /modules/protocol/bahamut.cpp | |
| parent | 109d1744a077faf3de5a218fddfd9ae2bdd5d245 (diff) | |
Fixed aborting because of invalid values given to mode +f on inspircd
Diffstat (limited to 'modules/protocol/bahamut.cpp')
| -rw-r--r-- | modules/protocol/bahamut.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index ecb493dba..a8cdef155 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -543,9 +543,13 @@ bool event_burst(const Anope::string &source, const std::vector<Anope::string> & bool ChannelModeFlood::IsValid(const Anope::string &value) const { - Anope::string rest; - if (!value.empty() && value[0] != ':' && convertTo<int>(value[0] == '*' ? value.substr(1) : value, rest, false) > 0 && rest[0] == ':' && rest.length() > 1 && convertTo<int>(rest.substr(1), rest, false) > 0 && rest.empty()) - return true; + try + { + Anope::string rest; + if (!value.empty() && value[0] != ':' && convertTo<int>(value[0] == '*' ? value.substr(1) : value, rest, false) > 0 && rest[0] == ':' && rest.length() > 1 && convertTo<int>(rest.substr(1), rest, false) > 0 && rest.empty()) + return true; + } + catch (const ConvertException &) { } return false; } |
