From: Philippe Antoine Date: Tue, 22 Feb 2022 12:10:59 +0000 (+0100) Subject: smtp: check if there is a transaction to close X-Git-Tag: suricata-5.0.9~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7213%2Fhead;p=thirdparty%2Fsuricata.git smtp: check if there is a transaction to close Ticket: 4948 When parsing the response for starttls (cherry picked from commit 99b3443369703ba69d962019edeca8f1c7c7896e) --- 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);