From 9639da32b7f8cd99d9d2429e82c742f31804b068 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sun, 24 Sep 2023 07:26:24 +0200 Subject: [PATCH] detect/content-inspect: minor code cleanups --- src/detect-engine-content-inspection.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/detect-engine-content-inspection.c b/src/detect-engine-content-inspection.c index 90e55c86f4..1ec78fb550 100644 --- a/src/detect-engine-content-inspection.c +++ b/src/detect-engine-content-inspection.c @@ -141,10 +141,8 @@ int DetectEngineContentInspectionInternal(DetectEngineCtx *de_ctx, DetectEngineT do { if ((cd->flags & DETECT_CONTENT_DISTANCE) || (cd->flags & DETECT_CONTENT_WITHIN)) { - SCLogDebug("det_ctx->buffer_offset %"PRIu32, det_ctx->buffer_offset); - + SCLogDebug("det_ctx->buffer_offset %" PRIu32, det_ctx->buffer_offset); offset = prev_buffer_offset; - depth = buffer_len; int distance = cd->distance; if (cd->flags & DETECT_CONTENT_DISTANCE) { @@ -266,7 +264,6 @@ int DetectEngineContentInspectionInternal(DetectEngineCtx *de_ctx, DetectEngineT const uint8_t *sbuffer = buffer + offset; uint32_t sbuffer_len = depth - offset; - uint32_t match_offset = 0; SCLogDebug("sbuffer_len %" PRIu32 " depth: %" PRIu32 ", buffer_len: %" PRIu32, sbuffer_len, depth, buffer_len); #ifdef DEBUG @@ -299,7 +296,7 @@ int DetectEngineContentInspectionInternal(DetectEngineCtx *de_ctx, DetectEngineT goto match; } } else { - match_offset = (uint32_t)((found - buffer) + cd->content_len); + uint32_t match_offset = (uint32_t)((found - buffer) + cd->content_len); if (cd->flags & DETECT_CONTENT_NEGATED) { SCLogDebug("content %" PRIu32 " matched at offset %" PRIu32 ", but negated so no match",