From 99b3443369703ba69d962019edeca8f1c7c7896e 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 --- 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 080a864092..ea11139580 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -928,7 +928,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