]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3778: actions: restore rtn check in Actions::alert and add to Actions...
authorOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Mon, 13 Mar 2023 07:58:20 +0000 (07:58 +0000)
committerOleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) <oshumeik@cisco.com>
Mon, 13 Mar 2023 07:58:20 +0000 (07:58 +0000)
Merge in SNORT/snort3 from ~ANOROKH/snort3:rtn_check to master

Squashed commit of the following:

commit d969e687476e4f6ca453fa0501691e93dd0b8442
Author: AnnaNorokh <annanorokh15@gmail.comm>
Date:   Thu Mar 9 16:00:01 2023 +0200

    actions: restore rtn check in Actions::alert and add to Actions::log

src/actions/actions.cc

index b516a838c0fdbc8ccab27aae9248067cc34c85fc..9320e8a59265e9126492052625ecdfc70d67c4a2 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "actions.h"
 
-#include <cassert>
-
 #include "detection/detect.h"
 #include "managers/action_manager.h"
 #include "parser/parser.h"
@@ -39,7 +37,9 @@ void Actions::pass()
 void Actions::log(Packet* p, const OptTreeNode* otn)
 {
     RuleTreeNode* rtn = getRtnFromOtn(otn);
-    assert(rtn);
+    if (!rtn)
+        return;
+
     CallLogFuncs(p, otn, rtn->listhead);
 }
 
@@ -49,7 +49,8 @@ void Actions::alert(Packet* p, const OptTreeNode* otn)
         return;
 
     RuleTreeNode* rtn = getRtnFromOtn(otn);
-    assert(rtn);
+    if (!rtn)
+        return;
 
     /* Call OptTreeNode specific output functions */
     if (otn->outputFuncs)