From: Adrian Mamolea (admamole) Date: Tue, 26 Mar 2024 14:27:58 +0000 (+0000) Subject: Pull request #4255: detection: handle policy changes in continuation X-Git-Tag: 3.1.84.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ce7efdd113e289b0e4087129f295ba02bf0a651;p=thirdparty%2Fsnort3.git Pull request #4255: detection: handle policy changes in continuation Merge in SNORT/snort3 from ~ADMAMOLE/snort3:sse_policy_change to master Squashed commit of the following: commit 32fd659e58805f4a5c0f76954596e520e6c0a825 Author: Adrian Mamolea Date: Thu Mar 21 17:01:19 2024 -0400 detection: handle policy changes in continuation --- diff --git a/src/detection/fp_detect.cc b/src/detection/fp_detect.cc index df3c3c611..b909af47f 100644 --- a/src/detection/fp_detect.cc +++ b/src/detection/fp_detect.cc @@ -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;