]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/parse: fix crash on 'internal' keyword use
authorVictor Julien <victor@inliniac.net>
Tue, 31 Mar 2020 12:04:07 +0000 (14:04 +0200)
committerJeff Lucovsky <jeff@lucovsky.org>
Sun, 5 Apr 2020 19:04:42 +0000 (15:04 -0400)
When keyword __flowvar__postmatch__, an internal keyword, is used
in a rule the 'Setup' func ptr will be NULL. This caused a crash.

(cherry picked from commit 095981cb2a7b204e66770ab5ab4efcf5034caa27)

src/detect-parse.c

index d1a9a61a2cf7beba3b304b1d4c5066f3a447dbcc..a4f97563d97c944c980bb28fa9e5e369bbbe6a7e 100644 (file)
@@ -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;
     }