mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Prevent crash when calling bro -U [unwritable destination]
set_processing_status can be called before reporter is initialized or after it is deleted. Work around by sending data to stderr instead. Patch by Thomas Petersen.
This commit is contained in:
parent
c1f8e3baec
commit
2a873f5aed
1 changed files with 6 additions and 2 deletions
|
@ -1397,8 +1397,12 @@ void _set_processing_status(const char* status)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
strerror_r(errno, buf, sizeof(buf));
|
strerror_r(errno, buf, sizeof(buf));
|
||||||
|
if ( reporter )
|
||||||
reporter->Error("Failed to open process status file '%s': %s",
|
reporter->Error("Failed to open process status file '%s': %s",
|
||||||
proc_status_file, buf);
|
proc_status_file, buf);
|
||||||
|
else
|
||||||
|
fprintf(stderr, "Failed to open process status file '%s': %s\n",
|
||||||
|
proc_status_file, buf);
|
||||||
errno = old_errno;
|
errno = old_errno;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue