diff --git a/src/BroDoc.cc b/src/BroDoc.cc index 6953680df0..dd0e8ff37c 100644 --- a/src/BroDoc.cc +++ b/src/BroDoc.cc @@ -504,17 +504,35 @@ static void WritePluginComponents(FILE* f, const plugin::Plugin* p) { switch ( (*it)->Type() ) { case plugin::component::ANALYZER: - WriteAnalyzerComponent(f, - dynamic_cast(*it)); + { + const analyzer::Component* c = + dynamic_cast(*it); + + if ( c ) + WriteAnalyzerComponent(f, c); + else + reporter->InternalError("component type mismatch"); + } break; + case plugin::component::FILE_ANALYZER: - WriteAnalyzerComponent(f, - dynamic_cast(*it)); + { + const file_analysis::Component* c = + dynamic_cast(*it); + + if ( c ) + WriteAnalyzerComponent(f, c); + else + reporter->InternalError("component type mismatch"); + } break; + case plugin::component::READER: reporter->InternalError("docs for READER component unimplemented"); + case plugin::component::WRITER: reporter->InternalError("docs for WRITER component unimplemented"); + default: reporter->InternalError("docs for unknown component unimplemented"); } diff --git a/src/Debug.cc b/src/Debug.cc index b5aaf91f9f..d3cf042ccc 100644 --- a/src/Debug.cc +++ b/src/Debug.cc @@ -721,7 +721,7 @@ static char* get_prompt(bool reset_counter = false) string get_context_description(const Stmt* stmt, const Frame* frame) { ODesc d; - const BroFunc* func = frame->GetFunction(); + const BroFunc* func = frame ? frame->GetFunction() : 0; if ( func ) func->DescribeDebug(&d, frame->GetFuncArgs());