From: Jeff Lucovsky Date: Sat, 11 Jan 2025 14:23:50 +0000 (-0500) Subject: log/file: Ensure file ctx pointer is returned . X-Git-Tag: suricata-7.0.9~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a10ee8d6bc579acbc3f88ba69b2b170b74fec9da;p=thirdparty%2Fsuricata.git log/file: Ensure file ctx pointer is returned . The fix for issue 7447 introduced an error with threaded eve output. The changes that were committed for that issue mishandled the return value when a file is being opened for the 2nd or higher time. Instead of returning the existing file context, null was returned. (cherry picked from commit 1d996c5aed820c34add5693a7a1bd4be00a1e304) --- diff --git a/src/util-logopenfile.c b/src/util-logopenfile.c index 5f0cb01fe5..6f272bca65 100644 --- a/src/util-logopenfile.c +++ b/src/util-logopenfile.c @@ -735,6 +735,8 @@ LogFileCtx *LogFileEnsureExists(LogFileCtx *parent_ctx) "Unable to open slot %d for file %s", entry->slot_number, parent_ctx->filename); (void)HashTableRemove(parent_ctx->threads->ht, entry, 0); } + } else { + ret_ctx = entry->ctx; } SCMutexUnlock(&parent_ctx->threads->mutex);