mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
packet_analysis: Protect from nullptr sessions
Passing nullptr sessions to AnalyzerConfirmation and AnalyzerViolation of protocol analyzers previously blew up - protect from that. Related to zeek/spicy-plugin#133.
This commit is contained in:
parent
fdedc6b200
commit
fbf379b757
1 changed files with 6 additions and 0 deletions
|
@ -186,6 +186,9 @@ void Analyzer::AnalyzerConfirmation(session::Session* session, zeek::Tag arg_tag
|
|||
{
|
||||
const auto& effective_tag = arg_tag ? arg_tag : GetAnalyzerTag();
|
||||
|
||||
if ( ! session )
|
||||
return;
|
||||
|
||||
if ( session->AnalyzerState(effective_tag) == session::AnalyzerConfirmationState::CONFIRMED )
|
||||
return;
|
||||
|
||||
|
@ -242,6 +245,9 @@ void Analyzer::AnalyzerViolation(const char* reason, session::Session* session,
|
|||
{
|
||||
const auto& effective_tag = arg_tag ? arg_tag : GetAnalyzerTag();
|
||||
|
||||
if ( ! session )
|
||||
return;
|
||||
|
||||
if ( session->AnalyzerState(effective_tag) == session::AnalyzerConfirmationState::VIOLATED )
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue