From a0fe67a3c0c980fe409ec4fb206fc24a5caf059b Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 15 Oct 2016 19:26:48 +0200 Subject: [PATCH] detect: template list in engine --- src/detect-engine-template.c | 10 ++++------ src/detect-engine.c | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/detect-engine-template.c b/src/detect-engine-template.c index 9ad8ff5936..422a8a3d1e 100644 --- a/src/detect-engine-template.c +++ b/src/detect-engine-template.c @@ -45,15 +45,13 @@ int DetectEngineInspectTemplateBuffer(ThreadVars *tv, int ret = 0; if (flags & STREAM_TOSERVER && tx->request_buffer != NULL) { - ret = DetectEngineContentInspection(de_ctx, det_ctx, s, - s->sm_lists[DETECT_SM_LIST_TEMPLATE_BUFFER_MATCH], f, - tx->request_buffer, tx->request_buffer_len, 0, + ret = DetectEngineContentInspection(de_ctx, det_ctx, s, sm, + f, tx->request_buffer, tx->request_buffer_len, 0, DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE, NULL); } else if (flags & STREAM_TOCLIENT && tx->response_buffer != NULL) { - ret = DetectEngineContentInspection(de_ctx, det_ctx, s, - s->sm_lists[DETECT_SM_LIST_TEMPLATE_BUFFER_MATCH], f, - tx->response_buffer, tx->response_buffer_len, 0, + ret = DetectEngineContentInspection(de_ctx, det_ctx, s, sm, + f, tx->response_buffer, tx->response_buffer_len, 0, DETECT_ENGINE_CONTENT_INSPECTION_MODE_STATE, NULL); } diff --git a/src/detect-engine.c b/src/detect-engine.c index ad86cc0c69..b1d4a24cfb 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -206,6 +206,8 @@ int DetectEngineAppInspectionEngine2Signature(Signature *s) case DETECT_SM_LIST_CIP_MATCH: case DETECT_SM_LIST_ENIP_MATCH: + case DETECT_SM_LIST_TEMPLATE_BUFFER_MATCH: + new_engine->sm = s->sm_lists[new_engine->sm_list]; s->sm_lists[new_engine->sm_list] = NULL; s->sm_lists_tail[new_engine->sm_list] = NULL;