From b7fd01c86e0d0f3c341031d62ec89e305859aa0b Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Sun, 7 Feb 2021 21:34:12 +0100 Subject: [PATCH] detect: forbids unsupported prefilters --- src/detect-prefilter.c | 5 +++++ 1 file changed, 5 insertions(+) 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;