From: Philippe Antoine Date: Tue, 25 Jan 2022 20:10:37 +0000 (+0100) Subject: smtp: check if we have a current transaction X-Git-Tag: suricata-5.0.9~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ea257d5af7e2c11711c7a20c8b21f3e39519be0;p=thirdparty%2Fsuricata.git smtp: check if we have a current transaction Ticket: 4948 This is not the perfect solution, but it prevents to trigger the assert, and keep the assert. A better solution would need to create transaction from the reponse parsing, in case a later command was buffered and not answered. But this would not be enough as NoNewTx prevents the creation of a new transaction for RSET... (cherry picked from commit 4247605d874113ef13003816007e0575219d065e) --- diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index 87809db24d..09e01b0b5d 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -1059,7 +1059,7 @@ static int SMTPProcessReply(SMTPState *state, Flow *f, SMTPSetEvent(state, SMTP_DECODER_EVENT_DATA_COMMAND_REJECTED); } } else if (IsReplyToCommand(state, SMTP_COMMAND_RSET)) { - if (reply_code == SMTP_REPLY_250 && + if (reply_code == SMTP_REPLY_250 && state->curr_tx && !(state->parser_state & SMTP_PARSER_STATE_PARSING_MULTILINE_REPLY)) { SMTPTransactionComplete(state); }