]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: allow 0-sized non-NULL buffers to match
authorPhilippe Antoine <pantoine@oisf.net>
Thu, 27 Apr 2023 14:39:31 +0000 (16:39 +0200)
committerVictor Julien <vjulien@oisf.net>
Fri, 5 May 2023 08:27:35 +0000 (10:27 +0200)
Such as a HTTP1 header with an empty value

Ticket: #6025

src/detect-engine-content-inspection.c

index f639b4f81fa96681fa137cebe2f22b891c6ee072..edb7804b24a2242bedfcc235137e74bdcfe8dce6 100644 (file)
@@ -118,7 +118,8 @@ uint8_t DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThrea
         SCReturnInt(0);
     }
 
-    if (smd == NULL || buffer_len == 0) {
+    // we want the ability to match on bsize: 0
+    if (smd == NULL || buffer == NULL) {
         KEYWORD_PROFILING_END(det_ctx, smd->type, 0);
         SCReturnInt(0);
     }