From c5041d35d57ae8b72f14660703972c1104eac0fc Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 10 Mar 2014 12:39:19 +0100 Subject: [PATCH] Fix live reload Fix memsets clearing out of bounds memory on live reload, causing crashes and corrupted backtraces. Bug #1128. --- src/detect-engine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detect-engine.c b/src/detect-engine.c index c35786d36d..92526582ca 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -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); -- 2.47.2