]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Fix live reload 883/head
authorVictor Julien <victor@inliniac.net>
Mon, 10 Mar 2014 11:39:19 +0000 (12:39 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 10 Mar 2014 13:08:06 +0000 (14:08 +0100)
Fix memsets clearing out of bounds memory on live reload, causing
crashes and corrupted backtraces.

Bug #1128.

src/detect-engine.c

index c35786d36d47201e19ce3fb9cee714acf5ba4dde..92526582ca12b042beed18b0ecb352c24660e46c 100644 (file)
@@ -499,9 +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)));
+    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);