]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #3811: main: reset the global s_network_policy pointer at main thread...
authorSteve Chew (stechew) <stechew@cisco.com>
Thu, 27 Apr 2023 17:34:25 +0000 (17:34 +0000)
committerSteve Chew (stechew) <stechew@cisco.com>
Thu, 27 Apr 2023 17:34:25 +0000 (17:34 +0000)
Merge in SNORT/snort3 from ~SVLASIUK/snort3:firewall_hitcount to master

Squashed commit of the following:

commit f6930a067cc2252a15efb9eea16692b7ade6295e
Author: Serhii Vlasiuk <svlasiuk@cisco.com>
Date:   Thu Apr 13 20:02:46 2023 +0300

    managers: check main SnortConfig pointer in InspectorManager::get_inspector() to avoid memory bad access calls

src/managers/inspector_manager.cc

index aa2a5dc217c0fa255e4dccc973a3035532f5a784..5202e3512def73417819ed695a8a0340a2ca05a8 100644 (file)
@@ -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)
     {