mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
Allow IRC commands to not have parameters.
When testing against irc-dcc-send.trace, I didn't see an irc_quit_message event generated for the QUIT command at the end of the trace, but rather a weird.log "irc_invalid_line" for the packet: the IRC packet parser wasn't allowing commands without parameters.
This commit is contained in:
parent
ba8742ebb4
commit
2ae80640cb
1 changed files with 5 additions and 5 deletions
|
@ -112,16 +112,16 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
|
|||
return;
|
||||
|
||||
unsigned int pos = myline.find(' ');
|
||||
// Not all commands require parameters
|
||||
if ( pos > (unsigned int) length )
|
||||
{
|
||||
Weird("irc_invalid_line");
|
||||
return;
|
||||
}
|
||||
|
||||
pos = (unsigned int) length;
|
||||
command = myline.substr(0, pos);
|
||||
for ( unsigned int i = 0; i < command.size(); ++i )
|
||||
command[i] = toupper(command[i]);
|
||||
|
||||
// Adjust for the no-parameter case
|
||||
if ( pos == (unsigned int) length )
|
||||
pos--;
|
||||
myline = myline.substr(pos + 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue