detect/parse: fix crash on 'internal' keyword use

When keyword __flowvar__postmatch__, an internal keyword, is used
in a rule the 'Setup' func ptr will be NULL. This caused a crash.
pull/4765/head
Victor Julien 5 years ago
parent 1e71eecf47
commit 095981cb2a

@ -694,7 +694,7 @@ static int SigParseOptions(DetectEngineCtx *de_ctx, Signature *s, char *optstr,
/* Call option parsing */
st = SigTableGet(optname);
if (st == NULL) {
if (st == NULL || st->Setup == NULL) {
SCLogError(SC_ERR_RULE_KEYWORD_UNKNOWN, "unknown rule keyword '%s'.", optname);
goto error;
}

Loading…
Cancel
Save