Skip to content

Commit

Permalink
detect: negated content matches on absent buffer
Browse files Browse the repository at this point in the history
Ticket: 2224
  • Loading branch information
catenacyber committed Nov 30, 2023
1 parent 9c3ab36 commit 1356c98
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/detect-engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -2192,6 +2192,12 @@ uint8_t DetectEngineInspectBufferGeneric(DetectEngineCtx *de_ctx, DetectEngineTh
const InspectionBuffer *buffer = engine->v2.GetData(det_ctx, transforms,
f, flags, txv, list_id);
if (unlikely(buffer == NULL)) {
if (eof && engine->smd->type == DETECT_CONTENT) {
DetectContentData *cd = (DetectContentData *)engine->smd->ctx;
if (cd->flags & DETECT_CONTENT_NEGATED) {
return DETECT_ENGINE_INSPECT_SIG_MATCH;
}
}
return eof ? DETECT_ENGINE_INSPECT_SIG_CANT_MATCH :
DETECT_ENGINE_INSPECT_SIG_NO_MATCH;
}
Expand Down

0 comments on commit 1356c98

Please sign in to comment.