]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3822: Pull request #592: flow: Defensive fix to prevent crash if flow...
authorSteven Baigal (sbaigal) <sbaigal@cisco.com>
Wed, 26 Apr 2023 14:56:07 +0000 (14:56 +0000)
committerSteven Baigal (sbaigal) <sbaigal@cisco.com>
Wed, 26 Apr 2023 14:56:07 +0000 (14:56 +0000)
Merge in SNORT/snort3 from ~SBAIGAL/snort3:unideffixmaster to master

Squashed commit of the following:

commit d993b3cb09234ca2333fbf370ddbc0f168e5bfc7
Author: Steven Baigal (sbaigal) <sbaigal@cisco.com>
Date:   Tue Apr 18 22:47:33 2023 +0000

    Pull request #592: flow: Defensive fix to prevent crash if flow->prev is nullptr.

    Merge in FIREPOWER/snort3 from ~STECHEW/snort3:uni_defensive_fix to release/7.4.0

    * commit '8e476581a05fb61df0138ce30d6a9ebc9d053447':
      flow: Defensive fix to prevent crash if flow->prev is nullptr.

src/flow/flow_uni_list.h

index 614276ba19ed5b787d84f05ad4cc9f34e9555a79..a25f29b429d7b04b83ec3c80349e79fdf7338f7a 100644 (file)
@@ -54,7 +54,9 @@ public:
 
     bool unlink_uni(snort::Flow* flow)
     {
-        if ( !flow->next )
+        // FIXIT-H: Checking flow->prev is a defensive fix but doesn't resolve the
+        // root cause of how next and prev could be different.
+        if ( !flow->next or !flow->prev )
             return false;
 
         flow->next->prev = flow->prev;