Fix live reload

Fix memsets clearing out of bounds memory on live reload, causing
crashes and corrupted backtraces.

Bug #1128.
pull/883/head
Victor Julien 12 years ago
parent fdb1bd9668
commit c5041d35d5

@ -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);

Loading…
Cancel
Save