From: Michael Altizer (mialtize) Date: Tue, 8 May 2018 15:07:54 +0000 (-0400) Subject: Merge pull request #1220 in SNORT/snort3 from snort_flags to master X-Git-Tag: 3.0.0-245~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d83869428e6b2c14501ae683453ac313d4bb6d3;p=thirdparty%2Fsnort3.git Merge pull request #1220 in SNORT/snort3 from snort_flags to master Squashed commit of the following: commit 0a24fb7ce8064554e70371c0b3553306700e0a55 Author: Cristian Date: Tue May 8 02:17:01 2018 -0400 ips_flags: remove dead code --- diff --git a/src/ips_options/ips_flags.cc b/src/ips_options/ips_flags.cc index c9af1a28d..c323b9f52 100644 --- a/src/ips_options/ips_flags.cc +++ b/src/ips_options/ips_flags.cc @@ -22,6 +22,8 @@ #include "config.h" #endif +#include + #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);