From 9f4dd4fc56a8885bdff0714352dffa5b897f5979 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 23 Nov 2022 14:42:21 +0100 Subject: [PATCH] smtp/files: don't modify prev file on open failure --- 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 45836c5efd..9b4a27a676 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -529,8 +529,9 @@ int SMTPProcessDataChunk(const uint8_t *chunk, uint32_t len, (uint8_t *)entity->filename, flen, (uint8_t *)chunk, len, flags) != 0) { ret = MIME_DEC_ERR_DATA; SCLogDebug("FileOpenFile() failed"); + } else { + SMTPNewFile(tx, files->tail); } - SMTPNewFile(tx, files->tail); /* If close in the same chunk, then pass in empty bytes */ if (state->body_end) { -- 2.47.2