From: Philippe Antoine Date: Sun, 7 Feb 2021 20:34:12 +0000 (+0100) Subject: detect: forbids unsupported prefilters X-Git-Tag: suricata-7.0.0-beta1~1785 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7fd01c86e0d0f3c341031d62ec89e305859aa0b;p=thirdparty%2Fsuricata.git detect: forbids unsupported prefilters --- diff --git a/src/detect-prefilter.c b/src/detect-prefilter.c index 4aab7c1655..d91edcb17f 100644 --- a/src/detect-prefilter.c +++ b/src/detect-prefilter.c @@ -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;