]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4328: flow: add the newly-created flow to p->flow to avoid segv
authorMichael Matirko (mmatirko) <mmatirko@cisco.com>
Tue, 21 May 2024 15:22:42 +0000 (15:22 +0000)
committerSteven Baigal (sbaigal) <sbaigal@cisco.com>
Tue, 21 May 2024 15:22:42 +0000 (15:22 +0000)
Merge in SNORT/snort3 from ~MMATIRKO/snort3:flowip_segv to master

Squashed commit of the following:

commit a24e308afb9eaef51ccad16a2a269918fdf607c0
Author: Michael Matirko <mmatirko@cisco.com>
Date:   Wed May 8 20:05:48 2024 -0400

    flow: add the newly-created flow to p->flow to avoid segv

src/flow/ha.cc
src/network_inspectors/perf_monitor/perf_monitor.cc

index 978ac618d4d923c2f042a36a967bdd91409c14c1..b08541a111e405552d087d720e2221532d769834 100644 (file)
@@ -438,6 +438,7 @@ static Flow* consume_ha_update_message(HAMessage& msg, const FlowKey& key, Packe
 
     if( p && no_flow_found && flow && flow->session )
     {
+        p->flow = flow;
         flow->session->setup(p);
         flow->set_direction(p);
         flow->set_client_initiate(p);
index 59a08f4398326d2c63cc8e9b89be1b6543b7f3f2..3a7720802488be6e54205d0241d54c0b73d9a67e 100644 (file)
@@ -94,7 +94,7 @@ public:
     {
         FlowIPTracker* tracker = perf_monitor.get_flow_ip();
 
-        if (!tracker)
+        if (!tracker or !flow)
             return;
 
         FlowState state = SFS_STATE_MAX;