diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-05 10:10:34 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-05 10:10:34 +0000 |
commit | 484bf7243ef0098cb9d1fa367ea66876eab0e9c6 (patch) | |
tree | 9ea9a49ed64b40190e15819de8bff1dcb06ffa81 /src | |
parent | bc4828bbbde8a596b80b8f1d2c7349551f0f43b8 (diff) |
Add sanity checks to LoopCall to prevent miscalls like this by broken 3rd party modules
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9643 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/command_parse.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp index d6e5f3c56..4c9701645 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -50,6 +50,9 @@ int InspIRCd::PassCompare(Extensible* ex, const char* data,const char* input, co */ int CommandParser::LoopCall(User* user, Command* CommandObj, const std::vector<std::string>& parameters, unsigned int splithere, unsigned int extra) { + if (splithere >= parameters.size()) + return 0; + /* First check if we have more than one item in the list, if we don't we return zero here and the handler * which called us just carries on as it was. */ @@ -99,6 +102,9 @@ int CommandParser::LoopCall(User* user, Command* CommandObj, const std::vector<s int CommandParser::LoopCall(User* user, Command* CommandObj, const std::vector<std::string>& parameters, unsigned int splithere) { + if (splithere >= parameters.size()) + return 0; + /* First check if we have more than one item in the list, if we don't we return zero here and the handler * which called us just carries on as it was. */ |