]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add sanity checks to LoopCall to prevent miscalls like this by broken 3rd party modules
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 5 May 2008 10:10:34 +0000 (10:10 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 5 May 2008 10:10:34 +0000 (10:10 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9643 e03df62e-2008-0410-955e-edbf42e46eb7

src/command_parse.cpp

index d6e5f3c56bc2d19014daafb9e8f9c8c6675a3d7e..4c9701645fb79ab86dbf93e1420f9a4b53d21dc6 100644 (file)
@@ -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.
         */