Merge in SNORT/snort3 from ~STECHEW/snort3:detection_fix to master
Squashed commit of the following:
commit
fcfd02235de65ead825b0892946c8f960104e4d6
Author: Steve Chew <stechew@cisco.com>
Date: Tue Jun 6 23:20:28 2023 -0400
detection: Handle case when no rule tree node is found for a policy ID.
** OptTreeNode * - the otn to add.
**
** FORMAL OUTPUTS
-** int - 1 max_events variable hit, 0 successful.
+** int - 2 No rule tree node found for given policy ID.
+** int - 1 max_events variable hit.
+** int - 0 successful.
**
*/
int fpAddMatch(OtnxMatchData* omd, const OptTreeNode* otn)
{
RuleTreeNode* rtn = getRtnFromOtn(otn);
+ if ( not rtn )
+ return 2;
+
unsigned evalIndex = rtn->listhead->ruleListNode->evalIndex;
const SnortConfig* sc = SnortConfig::get_conf();