]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1220 in SNORT/snort3 from snort_flags to master
authorMichael Altizer (mialtize) <mialtize@cisco.com>
Tue, 8 May 2018 15:07:54 +0000 (11:07 -0400)
committerMichael Altizer (mialtize) <mialtize@cisco.com>
Tue, 8 May 2018 15:07:54 +0000 (11:07 -0400)
Squashed commit of the following:

commit 0a24fb7ce8064554e70371c0b3553306700e0a55
Author: Cristian <candrone@cisco.com>
Date:   Tue May 8 02:17:01 2018 -0400

    ips_flags: remove dead code

src/ips_options/ips_flags.cc

index c9af1a28d0fab006ac19899f293ba5c50d714c6b..c323b9f521596663500af919a52b9d536c1e1ee0 100644 (file)
@@ -22,6 +22,8 @@
 #include "config.h"
 #endif
 
+#include <cassert>
+
 #include "framework/ips_option.h"
 #include "framework/module.h"
 #include "hash/hashfcn.h"
@@ -174,22 +176,7 @@ static void flags_parse_test(const char* rule, TcpFlagCheckData* idx)
     const char* fend;
 
     fptr = rule;
-
-    /* make sure there is at least a split pointer */
-    if (fptr == nullptr)
-    {
-        ParseError("flags missing in TCP flag rule");
-        return;
-    }
-
-    while (isspace((u_char) *fptr))
-        fptr++;
-
-    if (strlen(fptr) == 0)
-    {
-        ParseError("flags missing in TCP flag rule");
-        return;
-    }
+    assert(fptr and *fptr);
 
     /* find the end of the alert string */
     fend = fptr + strlen(fptr);
@@ -277,22 +264,7 @@ static void flags_parse_mask(const char* rule, TcpFlagCheckData* idx)
     const char* fend;
 
     fptr = rule;
-
-    /* make sure there is at least a split pointer */
-    if (fptr == nullptr)
-    {
-        ParseError("flags missing in TCP flag rule");
-        return;
-    }
-
-    while (isspace((u_char) *fptr))
-        fptr++;
-
-    if (strlen(fptr) == 0)
-    {
-        ParseError("flags missing in TCP flag rule");
-        return;
-    }
+    assert(fptr and *fptr);
 
     /* find the end of the alert string */
     fend = fptr + strlen(fptr);