From: Steven Baigal (sbaigal) Date: Wed, 26 Apr 2023 14:56:07 +0000 (+0000) Subject: Pull request #3822: Pull request #592: flow: Defensive fix to prevent crash if flow... X-Git-Tag: 3.1.61.0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d40cdbc14e1535871c5b30a085f5fc85f31420f;p=thirdparty%2Fsnort3.git Pull request #3822: Pull request #592: flow: Defensive fix to prevent crash if flow->prev is nullptr. Merge in SNORT/snort3 from ~SBAIGAL/snort3:unideffixmaster to master Squashed commit of the following: commit d993b3cb09234ca2333fbf370ddbc0f168e5bfc7 Author: Steven Baigal (sbaigal) 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. --- diff --git a/src/flow/flow_uni_list.h b/src/flow/flow_uni_list.h index 614276ba1..a25f29b42 100644 --- a/src/flow/flow_uni_list.h +++ b/src/flow/flow_uni_list.h @@ -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;