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.
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;