]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4255: detection: handle policy changes in continuation
authorAdrian Mamolea (admamole) <admamole@cisco.com>
Tue, 26 Mar 2024 14:27:58 +0000 (14:27 +0000)
committerOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Tue, 26 Mar 2024 14:27:58 +0000 (14:27 +0000)
Merge in SNORT/snort3 from ~ADMAMOLE/snort3:sse_policy_change to master

Squashed commit of the following:

commit 32fd659e58805f4a5c0f76954596e520e6c0a825
Author: Adrian Mamolea <admamole@cisco.com>
Date:   Thu Mar 21 17:01:19 2024 -0400

    detection: handle policy changes in continuation

src/detection/fp_detect.cc

index df3c3c6119dea6c3ddd74e83d702d82500b44209..b909af47f94874a2c0c199faae5d1340f3d609f5 100644 (file)
@@ -285,6 +285,7 @@ int fpLogEvent(const RuleTreeNode* rtn, const OptTreeNode* otn, Packet* p)
 **    OptTreeNode        * - the otn to add.
 **
 **  FORMAL OUTPUTS
+**    int - 2 rule no longer enabled in current policy.
 **    int - 1 max_events variable hit.
 **    int - 0 successful.
 **
@@ -292,7 +293,8 @@ int fpLogEvent(const RuleTreeNode* rtn, const OptTreeNode* otn, Packet* p)
 int fpAddMatch(OtnxMatchData* omd, const OptTreeNode* otn)
 {
     RuleTreeNode* rtn = getRtnFromOtn(otn);
-    assert(rtn);
+    if ( !rtn )
+        return 2;
 
     unsigned evalIndex = rtn->listhead->ruleListNode->evalIndex;