From 1f7f13674883ceb76397d86059b76eb0295980d3 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 23 Oct 2018 15:01:42 +0200 Subject: [PATCH] coverity: suppress warnings --- src/detect-engine.c | 1 + src/util-pidfile.c | 1 + src/util-storage.c | 1 + 3 files changed, 3 insertions(+) diff --git a/src/detect-engine.c b/src/detect-engine.c index 8580bb013e..978bf34bb3 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -1558,6 +1558,7 @@ static void DetectEngineThreadCtxDeinitGlobalKeywords(DetectEngineThreadCtx *det static int DetectEngineThreadCtxInitKeywords(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx) { if (de_ctx->keyword_id > 0) { + // coverity[suspicious_sizeof : FALSE] det_ctx->keyword_ctxs_array = SCMalloc(de_ctx->keyword_id * sizeof(void *)); if (det_ctx->keyword_ctxs_array == NULL) { SCLogError(SC_ERR_DETECT_PREPARE, "setting up thread local detect ctx"); diff --git a/src/util-pidfile.c b/src/util-pidfile.c index a68188b7e6..382e678273 100644 --- a/src/util-pidfile.c +++ b/src/util-pidfile.c @@ -109,6 +109,7 @@ int SCPidfileTestRunning(const char *pid_filename) pid_t pidv; FILE *pf; + // coverity[toctou : FALSE] pf = fopen(pid_filename, "r"); if (pf == NULL) { SCLogError(SC_ERR_INITIALIZATION, diff --git a/src/util-storage.c b/src/util-storage.c index 21bbf4e061..7954f29765 100644 --- a/src/util-storage.c +++ b/src/util-storage.c @@ -259,6 +259,7 @@ void *StorageAllocById(Storage **storage, StorageEnum type, int id) StorageMapping *map = &storage_map[type][id]; Storage *store = *storage; if (store == NULL) { + // coverity[suspicious_sizeof : FALSE] store = SCMalloc(sizeof(void *) * storage_max_id[type]); if (unlikely(store == NULL)) return NULL; -- 2.47.2