]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect-fast-pattern: Mark as OPTIONAL_OPT, instead of NOOPT 5861/head
authorGianni Tedesco <gianni@scaramanga.co.uk>
Sun, 13 Dec 2020 14:50:23 +0000 (23:50 +0900)
committerJeff Lucovsky <jeff@lucovsky.org>
Mon, 15 Feb 2021 13:50:53 +0000 (08:50 -0500)
Also update the erroneous comment about it.

(cherry picked from commit cebe15c23b48e92df5181b3f0b0e6ac7195d717b)

src/detect-fast-pattern.c

index afcdfc54b9a0be5c2b18d00a9fe934e8bdee6d4c..e656aa111a04d26e2afcba945381cf10e1a62e14 100644 (file)
@@ -170,9 +170,10 @@ void DetectFastPatternRegister(void)
     sigmatch_table[DETECT_FAST_PATTERN].Match = NULL;
     sigmatch_table[DETECT_FAST_PATTERN].Setup = DetectFastPatternSetup;
     sigmatch_table[DETECT_FAST_PATTERN].Free  = NULL;
+#ifdef UNITTESTS
     sigmatch_table[DETECT_FAST_PATTERN].RegisterTests = DetectFastPatternRegisterTests;
-
-    sigmatch_table[DETECT_FAST_PATTERN].flags |= SIGMATCH_NOOPT;
+#endif
+    sigmatch_table[DETECT_FAST_PATTERN].flags |= SIGMATCH_OPTIONAL_OPT;
 
     DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study);
 }
@@ -185,7 +186,7 @@ void DetectFastPatternRegister(void)
  *
  * \param de_ctx   Pointer to the Detection Engine Context.
  * \param s        Pointer to the Signature to which the current keyword belongs.
- * \param null_str Should hold an empty string always.
+ * \param arg      May hold an argument
  *
  * \retval  0 On success.
  * \retval -1 On failure.