From: Jeff Lucovsky Date: Thu, 14 Sep 2023 14:30:13 +0000 (-0400) Subject: detect/rule: Use de_ctx buffer id X-Git-Tag: suricata-7.0.2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01d232b6be153700d443337f728c2f664159cd85;p=thirdparty%2Fsuricata.git detect/rule: Use de_ctx buffer id This commit uses the detect engine buffer id instead of the global value. Issue: 5211 --- diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index aa12ab56a8..80f5d89757 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -640,7 +640,7 @@ static json_t *RulesGroupPrintSghStats(const DetectEngineCtx *de_ctx, const SigG uint32_t mpms_min = 0; uint32_t mpms_max = 0; - int max_buffer_type_id = DetectBufferTypeMaxId() + 1; + int max_buffer_type_id = de_ctx->buffer_type_id; struct { uint32_t total; @@ -755,6 +755,7 @@ static json_t *RulesGroupPrintSghStats(const DetectEngineCtx *de_ctx, const SigG if (w > mpms_max) mpms_max = w; + BUG_ON(mpm_list >= max_buffer_type_id); mpm_stats[mpm_list].total += w; mpm_stats[mpm_list].cnt++; if (mpm_stats[mpm_list].min == 0 || w < mpm_stats[mpm_list].min)