From: Victor Julien Date: Wed, 26 Feb 2014 05:41:10 +0000 (+0100) Subject: rule reload: fix unitialized memory access on error X-Git-Tag: suricata-2.0rc2~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abdc0072aa7c19380030ac78bee19a83d57393c3;p=thirdparty%2Fsuricata.git rule reload: fix unitialized memory access on error Coverity 709220 --- diff --git a/src/detect-engine.c b/src/detect-engine.c index ebf6202212..c35786d36d 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -499,6 +499,9 @@ static void *DetectEngineLiveRuleSwap(void *arg) DetectEngineThreadCtx *old_det_ctx[no_of_detect_tvs]; DetectEngineThreadCtx *new_det_ctx[no_of_detect_tvs]; ThreadVars *detect_tvs[no_of_detect_tvs]; + memset(old_det_ctx, 0x00, (no_of_detect_tvs * sizeof(DetectEngineThreadCtx))); + memset(new_det_ctx, 0x00, (no_of_detect_tvs * sizeof(DetectEngineThreadCtx))); + memset(detect_tvs, 0x00, (no_of_detect_tvs * sizeof(ThreadVars))); SCMutexUnlock(&tv_root_lock);