mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
protection from bad frees on unallocated strings
This commit is contained in:
parent
2eeac54857
commit
c2ee15b09f
2 changed files with 4 additions and 4 deletions
|
@ -85,8 +85,8 @@ void BroDoc::AddImport(const std::string& s)
|
||||||
if ( ext_pos != std::string::npos )
|
if ( ext_pos != std::string::npos )
|
||||||
lname = lname.substr(0, ext_pos);
|
lname = lname.substr(0, ext_pos);
|
||||||
|
|
||||||
const char* full_filename = "<error>";
|
const char* full_filename = NULL;
|
||||||
const char* subpath = "<error>";
|
const char* subpath = NULL;
|
||||||
FILE* f = search_for_file(lname.c_str(), "bro", &full_filename, true,
|
FILE* f = search_for_file(lname.c_str(), "bro", &full_filename, true,
|
||||||
&subpath);
|
&subpath);
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ int TraceState::LogTrace(const char* fmt, ...)
|
||||||
|
|
||||||
if ( ! loc.filename )
|
if ( ! loc.filename )
|
||||||
{
|
{
|
||||||
loc.filename = "<no filename>";
|
loc.filename = copy_string("<no filename>");
|
||||||
loc.last_line = 0;
|
loc.last_line = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -735,7 +735,7 @@ string get_context_description(const Stmt* stmt, const Frame* frame)
|
||||||
loc = *stmt->GetLocationInfo();
|
loc = *stmt->GetLocationInfo();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
loc.filename = "<no filename>";
|
loc.filename = copy_string("<no filename>");
|
||||||
loc.last_line = 0;
|
loc.last_line = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue