]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
smtp: check if there is a transaction to close 7172/head
authorPhilippe Antoine <contact@catenacyber.fr>
Tue, 22 Feb 2022 12:10:59 +0000 (13:10 +0100)
committerVictor Julien <vjulien@oisf.net>
Fri, 25 Mar 2022 06:46:16 +0000 (07:46 +0100)
Ticket: 4948

When parsing the response for starttls

src/app-layer-smtp.c

index 080a86409252706ac810549ae521779b8a20da67..ea11139580f8179ae4a4abeb4eaa6c622204cd3f 100644 (file)
@@ -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);