diff options
author | Adam <Adam@anope.org> | 2013-07-02 01:56:13 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-07-02 01:56:13 -0400 |
commit | c62b3cb275800555f4e04f294d432dccf909d134 (patch) | |
tree | b58a4d88436883ff7af29c4fa5fb0e1ca9986b1e /modules/commands/cs_set_misc.cpp | |
parent | 1a3d9a016d3adc49788bbff73aac9b3b5ea85b17 (diff) |
Fix a few issues found by Attila (invalid array access in channel set events, os_chankill inf loop)
Diffstat (limited to 'modules/commands/cs_set_misc.cpp')
-rw-r--r-- | modules/commands/cs_set_misc.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/commands/cs_set_misc.cpp b/modules/commands/cs_set_misc.cpp index 5467e2b4e..dfcdc45a0 100644 --- a/modules/commands/cs_set_misc.cpp +++ b/modules/commands/cs_set_misc.cpp @@ -101,6 +101,7 @@ class CommandCSSetMisc : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { ChannelInfo *ci = ChannelInfo::Find(params[0]); + const Anope::string ¶m = params.size() > 1 ? params[1] : ""; if (ci == NULL) { source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str()); @@ -108,7 +109,7 @@ class CommandCSSetMisc : public Command } EventReturn MOD_RESULT; - FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1])); + FOREACH_RESULT(OnSetChannelOption, MOD_RESULT, (source, this, ci, param)); if (MOD_RESULT == EVENT_STOP) return; @@ -124,9 +125,9 @@ class CommandCSSetMisc : public Command if (item == NULL) return; - if (params.size() > 1) + if (!param.empty()) { - item->Set(ci, CSMiscData(ci, key, params[1])); + item->Set(ci, CSMiscData(ci, key, param)); source.Reply(CHAN_SETTING_CHANGED, scommand.c_str(), ci->name.c_str(), params[1].c_str()); } else |