]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rule reload: fix unitialized memory access on error
authorVictor Julien <victor@inliniac.net>
Wed, 26 Feb 2014 05:41:10 +0000 (06:41 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 26 Feb 2014 06:07:05 +0000 (07:07 +0100)
Coverity 709220

src/detect-engine.c

index ebf6202212a6a3fb49c3fbba96a6cf31d2365e45..c35786d36d47201e19ce3fb9cee714acf5ba4dde 100644 (file)
@@ -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);