From: Steve Chew (stechew) Date: Thu, 27 Apr 2023 17:34:25 +0000 (+0000) Subject: Pull request #3811: main: reset the global s_network_policy pointer at main thread... X-Git-Tag: 3.1.61.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4f0a4bd1d28e8f300c609bc53960bd589224c9f;p=thirdparty%2Fsnort3.git Pull request #3811: main: reset the global s_network_policy pointer at main thread as part of snort cleanup flow Merge in SNORT/snort3 from ~SVLASIUK/snort3:firewall_hitcount to master Squashed commit of the following: commit f6930a067cc2252a15efb9eea16692b7ade6295e Author: Serhii Vlasiuk Date: Thu Apr 13 20:02:46 2023 +0300 managers: check main SnortConfig pointer in InspectorManager::get_inspector() to avoid memory bad access calls --- diff --git a/src/managers/inspector_manager.cc b/src/managers/inspector_manager.cc index aa2a5dc21..5202e3512 100644 --- a/src/managers/inspector_manager.cc +++ b/src/managers/inspector_manager.cc @@ -1264,7 +1264,11 @@ Inspector* InspectorManager::get_inspector(const char* key, Module::Usage usage, InspectorType type, const SnortConfig* sc) { if ( !sc ) + { sc = SnortConfig::get_conf(); + if (!sc) + return nullptr; + } if (Module::GLOBAL == usage && IT_FILE == type) {