]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
smtp: check if there is a transaction to close 7213/head
authorPhilippe Antoine <contact@catenacyber.fr>
Tue, 22 Feb 2022 12:10:59 +0000 (13:10 +0100)
committerVictor Julien <vjulien@oisf.net>
Thu, 7 Apr 2022 06:40:52 +0000 (08:40 +0200)
Ticket: 4948

When parsing the response for starttls

(cherry picked from commit 99b3443369703ba69d962019edeca8f1c7c7896e)

src/app-layer-smtp.c

index 09e01b0b5d75c86deddf8e615ab94ab25210750d..bb377b0e784072b937ef8090dd41dc41c7e27a08 100644 (file)
@@ -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);