]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
smtp: check if there is a transaction to close
authorPhilippe Antoine <contact@catenacyber.fr>
Tue, 22 Feb 2022 12:10:59 +0000 (13:10 +0100)
committerShivani Bhardwaj <shivanib134@gmail.com>
Wed, 30 Mar 2022 05:32:27 +0000 (11:02 +0530)
Ticket: 4948

When parsing the response for starttls

(cherry picked from commit 99b3443369703ba69d962019edeca8f1c7c7896e)

src/app-layer-smtp.c

index 40607d9ef1d74e586cef2be99b54d41cdfc24ade..ba1d08c2ecea320b1e0b06433e3ed388ab1adc60 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);