]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixed frag alert squelching to restrict to fragged ip sessions only
authorrcombs <rcombs@sq18.sfeng.sourcefire.com>
Fri, 5 Dec 2014 22:53:32 +0000 (17:53 -0500)
committerrcombs <rcombs@sq18.sfeng.sourcefire.com>
Fri, 5 Dec 2014 22:53:32 +0000 (17:53 -0500)
src/stream/ip/ip_session.cc

index ef96d1746ec9e808d2ba3011a09c1b4747ca3b2a..d651d91c1189a5637ba35422ff854ca12570c2a7 100644 (file)
@@ -187,7 +187,7 @@ bool IpSession::add_alert(Packet*, uint32_t gid, uint32_t sid)
     FragTracker* ft = &tracker;
 
     /* Only track a certain number of alerts per session */
-    if ( ft->alert_count >= MAX_FRAG_ALERTS )
+    if ( !ft->engine || ft->alert_count >= MAX_FRAG_ALERTS )
         return false;
 
     ft->alert_gid[ft->alert_count] = gid;
@@ -201,6 +201,9 @@ bool IpSession::check_alerted(Packet* p, uint32_t gid, uint32_t sid)
 {
     FragTracker* ft = &tracker;
 
+    if ( !ft->engine )
+        return false;
+
     for ( unsigned i = 0; i < ft->alert_count; i++ )
     {
         /*  If this is a rebuilt packet and we've seen this alert before, return