Skip to content

Commit

Permalink
detect/content-inspect: minor code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Dec 1, 2023
1 parent a3ac3e6 commit 9639da3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/detect-engine-content-inspection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 9639da3

Please sign in to comment.