From 2535f416277da901ca7b0053306539b18123652e Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 22 Feb 2022 13:10:59 +0100 Subject: [PATCH] smtp: check if there is a transaction to close Ticket: 4948 When parsing the response for starttls (cherry picked from commit 99b3443369703ba69d962019edeca8f1c7c7896e) --- src/app-layer-smtp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index 09e01b0b5d..bb377b0e78 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -1045,7 +1045,9 @@ static int SMTPProcessReply(SMTPState *state, Flow *f, /* we are entering STARRTTLS data mode */ state->parser_state |= SMTP_PARSER_STATE_COMMAND_DATA_MODE; AppLayerRequestProtocolTLSUpgrade(f); - SMTPTransactionComplete(state); + if (state->curr_tx) { + SMTPTransactionComplete(state); + } } else { /* decoder event */ SMTPSetEvent(state, SMTP_DECODER_EVENT_TLS_REJECTED); -- 2.47.2