From e755913b4b6ca3d8f184932841c2f9e8f18fa479 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 19 Sep 2015 13:11:35 +0200 Subject: [PATCH] mpm: minor fixes and cleanups --- src/detect-engine-filedata-smtp.c | 5 ++--- src/detect-engine-mpm.c | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/detect-engine-filedata-smtp.c b/src/detect-engine-filedata-smtp.c index dc50d8c7d7..829832f9dc 100644 --- a/src/detect-engine-filedata-smtp.c +++ b/src/detect-engine-filedata-smtp.c @@ -267,7 +267,7 @@ int DetectEngineRunSMTPMpm(DetectEngineCtx *de_ctx, uint32_t cnt = 0; uint32_t buffer_len = 0; uint32_t stream_start_offset = 0; - uint8_t *buffer = 0; + uint8_t *buffer = NULL; if (ffc != NULL) { File *file = ffc->head; @@ -278,11 +278,10 @@ int DetectEngineRunSMTPMpm(DetectEngineCtx *de_ctx, flags, &buffer_len, &stream_start_offset); - if (buffer_len == 0) goto end; - cnt = SMTPFiledataPatternSearch(det_ctx, buffer, buffer_len, flags); + cnt += SMTPFiledataPatternSearch(det_ctx, buffer, buffer_len, flags); } } end: diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index c34ef25246..e9cf93fbe8 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -2383,7 +2383,6 @@ int PatternMatchPrepareGroup(DetectEngineCtx *de_ctx, SigGroupHead *sh) PatternMatchPreparePopulateMpm(de_ctx, sh); - //if (de_ctx->sgh_mpm_context == ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL) { if (sh->mpm_proto_tcp_ctx_ts != NULL) { if (sh->mpm_proto_tcp_ctx_ts->pattern_cnt == 0) { MpmFactoryReClaimMpmCtx(de_ctx, sh->mpm_proto_tcp_ctx_ts); @@ -2688,7 +2687,6 @@ int PatternMatchPrepareGroup(DetectEngineCtx *de_ctx, SigGroupHead *sh) } } } - //} /* if (de_ctx->sgh_mpm_context == ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL) */ } else { MpmFactoryReClaimMpmCtx(de_ctx, sh->mpm_proto_other_ctx); sh->mpm_proto_other_ctx = NULL;