mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Fixing a big pile of Coverity issues
1469562/1469558: Uninitialized fields in Func constructor 1469571/1469566: Null pointer dereference in Trigger::Init() 1469568: Uninitialized fields in CounterVector constructor 1469570: Uncaught exception in plugin manager 1469569: Resource leak in script_opt::Stmt 1469561/1469561: Uninitialized fields in ZBody constructor 1469559: Uninitialized fields in logging::Manager 1469563: Resource leak in ZAMCompiler::CompileDel 1469549/1469553/1469556: Context not fully initialized in HashVals 1469548: Remove dead code from IPAddr 1469551/1469554: Handle iosource_mgr registration failure in broker::Manager 1469552/1469572: Resource leaks in input::Manager
This commit is contained in:
parent
41abf8f422
commit
a117c81d85
13 changed files with 93 additions and 70 deletions
|
@ -423,16 +423,26 @@ void Manager::ExtendZeekPathForPlugins()
|
|||
if ( p->DynamicPlugin() || p->Name().empty() )
|
||||
continue;
|
||||
|
||||
string canon = std::regex_replace(p->Name(), std::regex("::"), "_");
|
||||
string dir = "builtin-plugins/" + canon;
|
||||
try
|
||||
{
|
||||
string canon = std::regex_replace(p->Name(), std::regex("::"), "_");
|
||||
string dir = "builtin-plugins/" + canon;
|
||||
|
||||
// Use find_file to find the directory in the path.
|
||||
string script_dir = util::find_file(dir, util::zeek_path());
|
||||
if ( script_dir.empty() || ! util::is_dir(script_dir) )
|
||||
continue;
|
||||
// Use find_file to find the directory in the path.
|
||||
string script_dir = util::find_file(dir, util::zeek_path());
|
||||
if ( script_dir.empty() || ! util::is_dir(script_dir) )
|
||||
continue;
|
||||
|
||||
DBG_LOG(DBG_PLUGINS, " Adding %s to ZEEKPATH", script_dir.c_str());
|
||||
path_additions.push_back(script_dir);
|
||||
DBG_LOG(DBG_PLUGINS, " Adding %s to ZEEKPATH", script_dir.c_str());
|
||||
path_additions.push_back(script_dir);
|
||||
}
|
||||
catch ( const std::regex_error& e )
|
||||
{
|
||||
// This really shouldn't ever happen, but we do need to catch the exception.
|
||||
// Report a fatal error because something is wrong if this occurs.
|
||||
reporter->FatalError("Failed to replace colons in plugin name %s: %s",
|
||||
p->Name().c_str(), e.what());
|
||||
}
|
||||
}
|
||||
|
||||
for ( const auto& plugin_path : path_additions )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue