]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: forbids unsupported prefilters
authorPhilippe Antoine <contact@catenacyber.fr>
Sun, 7 Feb 2021 20:34:12 +0000 (21:34 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 1 Mar 2021 07:25:56 +0000 (08:25 +0100)
(cherry picked from commit b7fd01c86e0d0f3c341031d62ec89e305859aa0b)

src/detect-prefilter.c

index 4aab7c16551665ce704ecf52305fd6384efa6317..d91edcb17f3da5dd34be5553c63ded04af834354 100644 (file)
@@ -71,6 +71,11 @@ static int DetectPrefilterSetup (DetectEngineCtx *de_ctx, Signature *s, const ch
         SCLogError(SC_ERR_INVALID_SIGNATURE, "prefilter needs preceding match");
         SCReturnInt(-1);
     }
+    if (sigmatch_table[sm->type].SupportsPrefilter == NULL) {
+        SCLogError(SC_ERR_INVALID_SIGNATURE, "prefilter is not supported for %s",
+                sigmatch_table[sm->type].name);
+        SCReturnInt(-1);
+    }
 
     s->init_data->prefilter_sm = sm;