X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommand_parse.cpp;h=4c9701645fb79ab86dbf93e1420f9a4b53d21dc6;hb=050e232499a04bb516c2dfee50b1f8c41ef1f5a6;hp=17334833860563c615647e50805bdc4e08c5d3b5;hpb=ffbd1eebf0b82bf40482879f410f58874030a695;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 173348338..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& 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& 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. */ @@ -267,10 +273,10 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) * the rfc says they shouldnt but also says the ircd should * discard it if they do. */ - if (*command.c_str() == ':') + if (command[0] == ':') tokens.GetToken(command); - while (tokens.GetToken(token) && (command_p.size() < MAXPARAMETERS)) + while (tokens.GetToken(token) && (command_p.size() <= MAXPARAMETERS)) command_p.push_back(token); std::transform(command.begin(), command.end(), command.begin(), ::toupper);