irc: Check parts.size() before removing the nick

...also, don't remove the nick twice.
This commit is contained in:
Arne Welzel 2022-09-04 17:19:01 +02:00 committed by Tim Wojtulewicz
parent ef81116278
commit 6b6bd7e9f6

View file

@ -426,9 +426,6 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
break;
vector<string> parts = SplitWords(params, ' ');
// Remove nick name.
parts.erase(parts.begin());
if ( parts.size() < 2 )
{
Weird("irc_invalid_whois_channel_line");
@ -436,6 +433,7 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
}
string nick = parts[0];
// Remove nick name.
parts.erase(parts.begin());
if ( parts.size() > 0 && parts[0][0] == ':' )