diff --git a/src/detect-file-data.c b/src/detect-file-data.c index e15db5b20731..53c046449f99 100644 --- a/src/detect-file-data.c +++ b/src/detect-file-data.c @@ -93,7 +93,8 @@ void DetectFiledataRegister(void) g_file_data_buffer_id = DetectBufferTypeGetByName("file_data"); } -static void SetupDetectEngineConfig(DetectEngineCtx *de_ctx) { +static void SetupDetectEngineConfig(DetectEngineCtx *de_ctx) +{ if (de_ctx->filedata_config) return; @@ -343,7 +344,7 @@ static InspectionBuffer *FiledataGetDataCallback(DetectEngineThreadCtx *det_ctx, /* update inspected tracker */ buffer->inspect_offset = offset; - if (ips && file_size < cur_file->inspect_min_size) { + if (ips && file_size < cur_file->inspect_min_size && cur_file->state == FILE_STATE_OPENED) { // don't update content_inspected yet } else { SCLogDebug("content inspected: %" PRIu64, cur_file->content_inspected);