mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
A couple null ptr checks.
This commit is contained in:
parent
daf5d0d098
commit
3c37e818ce
2 changed files with 23 additions and 5 deletions
|
@ -504,17 +504,35 @@ static void WritePluginComponents(FILE* f, const plugin::Plugin* p)
|
||||||
{
|
{
|
||||||
switch ( (*it)->Type() ) {
|
switch ( (*it)->Type() ) {
|
||||||
case plugin::component::ANALYZER:
|
case plugin::component::ANALYZER:
|
||||||
WriteAnalyzerComponent(f,
|
{
|
||||||
dynamic_cast<const analyzer::Component*>(*it));
|
const analyzer::Component* c =
|
||||||
|
dynamic_cast<const analyzer::Component*>(*it);
|
||||||
|
|
||||||
|
if ( c )
|
||||||
|
WriteAnalyzerComponent(f, c);
|
||||||
|
else
|
||||||
|
reporter->InternalError("component type mismatch");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case plugin::component::FILE_ANALYZER:
|
case plugin::component::FILE_ANALYZER:
|
||||||
WriteAnalyzerComponent(f,
|
{
|
||||||
dynamic_cast<const file_analysis::Component*>(*it));
|
const file_analysis::Component* c =
|
||||||
|
dynamic_cast<const file_analysis::Component*>(*it);
|
||||||
|
|
||||||
|
if ( c )
|
||||||
|
WriteAnalyzerComponent(f, c);
|
||||||
|
else
|
||||||
|
reporter->InternalError("component type mismatch");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case plugin::component::READER:
|
case plugin::component::READER:
|
||||||
reporter->InternalError("docs for READER component unimplemented");
|
reporter->InternalError("docs for READER component unimplemented");
|
||||||
|
|
||||||
case plugin::component::WRITER:
|
case plugin::component::WRITER:
|
||||||
reporter->InternalError("docs for WRITER component unimplemented");
|
reporter->InternalError("docs for WRITER component unimplemented");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
reporter->InternalError("docs for unknown component unimplemented");
|
reporter->InternalError("docs for unknown component unimplemented");
|
||||||
}
|
}
|
||||||
|
|
|
@ -721,7 +721,7 @@ static char* get_prompt(bool reset_counter = false)
|
||||||
string get_context_description(const Stmt* stmt, const Frame* frame)
|
string get_context_description(const Stmt* stmt, const Frame* frame)
|
||||||
{
|
{
|
||||||
ODesc d;
|
ODesc d;
|
||||||
const BroFunc* func = frame->GetFunction();
|
const BroFunc* func = frame ? frame->GetFunction() : 0;
|
||||||
|
|
||||||
if ( func )
|
if ( func )
|
||||||
func->DescribeDebug(&d, frame->GetFuncArgs());
|
func->DescribeDebug(&d, frame->GetFuncArgs());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue