Skip to content

Commit b8f40a6

Browse files
committed
smtp: don't create transaction for trailing quit
Ticket: OISF#8728
1 parent 6e4acda commit b8f40a6

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/app-layer-smtp.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,8 +1280,9 @@ static int SMTPProcessRequest(
12801280
if (line->len == 0 && line->delim_len == 0) {
12811281
return 0;
12821282
}
1283-
if (state->curr_tx == NULL ||
1284-
(SMTPTransactionRequestIsComplete(state->curr_tx) && !NoNewTx(state, line))) {
1283+
const bool no_new_tx = NoNewTx(state, line);
1284+
if ((state->curr_tx == NULL && !no_new_tx) ||
1285+
(SMTPTransactionRequestIsComplete(state->curr_tx) && !no_new_tx)) {
12851286
tx = SMTPTransactionCreate(state);
12861287
if (tx == NULL)
12871288
return -1;
@@ -1297,7 +1298,9 @@ static int SMTPProcessRequest(
12971298
if (frame != NULL && state->curr_tx) {
12981299
AppLayerFrameSetTxId(frame, state->curr_tx->tx_id);
12991300
}
1300-
tx->tx_data.updated_ts = true;
1301+
if (tx != NULL) {
1302+
tx->tx_data.updated_ts = true;
1303+
}
13011304

13021305
state->toserver_data_count += (line->len + line->delim_len);
13031306

0 commit comments

Comments
 (0)