From 5af5b125ee0a8a43ab8c510e4d7fc7054d77f133 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 25 Jan 2022 21:10:37 +0100 Subject: [PATCH] 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) --- src/app-layer-smtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index ba1d08c2ec..80f7e18d26 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -1061,7 +1061,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); } -- 2.47.2