mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Avoiding infinite loops when an error message handlers triggers errors
itself. If an error is triggered inside one of the reporter_* handlers, the message about that will now fall back to stderr.
This commit is contained in:
parent
66e2c3b623
commit
fb6a8cec19
16 changed files with 94 additions and 11 deletions
|
@ -25,6 +25,7 @@ Reporter::Reporter()
|
|||
{
|
||||
errors = 0;
|
||||
via_events = false;
|
||||
in_error_handler = 0;
|
||||
|
||||
openlog("bro", 0, LOG_LOCAL5);
|
||||
}
|
||||
|
@ -246,7 +247,7 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Conne
|
|||
FatalError("out of memory in Reporter");
|
||||
}
|
||||
|
||||
if ( event && via_events )
|
||||
if ( event && via_events && ! in_error_handler )
|
||||
{
|
||||
val_list* vl = new val_list;
|
||||
|
||||
|
@ -304,8 +305,6 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Conne
|
|||
fprintf(out, s.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( alloced )
|
||||
free(alloced);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue