From 6b6bd7e9f696ede4edab994e2b0ac731faf806ff Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Sun, 4 Sep 2022 17:19:01 +0200 Subject: [PATCH] irc: Check parts.size() before removing the nick ...also, don't remove the nick twice. --- src/analyzer/protocol/irc/IRC.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/analyzer/protocol/irc/IRC.cc b/src/analyzer/protocol/irc/IRC.cc index 1d566f113e..8ed4999a60 100644 --- a/src/analyzer/protocol/irc/IRC.cc +++ b/src/analyzer/protocol/irc/IRC.cc @@ -426,9 +426,6 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig) break; vector 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] == ':' )