From dca5cb3ab4df66a434d13b31d3aad0d911b90659 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Fri, 14 Aug 2026 12:23:15 -0600 Subject: [PATCH] smtp: handle file open failure Only call SMTPNewFile when FileOpenFileWithId succeeds. Ticket: #8813 --- src/app-layer-smtp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index 9b91375d9d..3bc0780418 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -929,8 +929,9 @@ static int SMTPProcessCommandDATA( state->file_track_id++, filename, filename_len, NULL, 0, flags) != 0) { SCLogDebug("FileOpenFile() failed"); + } else { + SMTPNewFile(state->curr_tx, tx->files_ts.tail); } - SMTPNewFile(state->curr_tx, tx->files_ts.tail); break; case MimeSmtpFileChunk: // rust already run FileAppendData