Skip to content

Commit 5e262ab

Browse files
committed
smtp: check transaction before to-client completion
Make sure the transaction still exists before completing it in the to-client direction. A pipelined RSET reply may already have completed and freed it while a later end-of-DATA marker still refers to it. Found by OSS-Fuzz testcase 5498180758994944. Bug OISF#8739.
1 parent 8455efd commit 5e262ab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/app-layer-smtp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ static int SMTPProcessReply(
10811081
} else if (IsReplyToCommand(state, SMTP_COMMAND_BDAT)) {
10821082
SMTPSetProgressTC(reply_tx, SMTP_RESPONSE_DATA);
10831083
} else if (IsReplyToCommand(state, SMTP_COMMAND_DATA_MODE)) {
1084-
if (!(state->parser_state & SMTP_PARSER_STATE_PARSING_MULTILINE_REPLY)) {
1084+
if (reply_tx && !(state->parser_state & SMTP_PARSER_STATE_PARSING_MULTILINE_REPLY)) {
10851085
SMTPTransactionCompleteTC(reply_tx);
10861086
}
10871087
} else if (IsReplyToCommand(state, SMTP_COMMAND_RSET)) {

0 commit comments

Comments
 (0)