mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Fixed Segmentation fault in SQLite Writer.
Segmentation fault caused by accessing fields with pos which is one-based for setting SQLite field values. Fix is to simply subtract one from pos. Discovered when trying to store HTTP traffic to a SQLite database with the following Bro script: event bro_init() { local filter: Log::Filter = [ $name = "sqlite", $path = "http", $config = table(["tablename"] = "http_logs"), $writer = Log::WRITER_SQLITE ]; Log::add_filter(HTTP::LOG, filter); }
This commit is contained in:
parent
071bd2689d
commit
cb6f6467c7
1 changed files with 2 additions and 2 deletions
|
@ -308,7 +308,7 @@ int SQLite::AddParams(Value* val, int pos)
|
|||
if ( j > 0 )
|
||||
desc.AddRaw(set_separator);
|
||||
|
||||
io->Describe(&desc, val->val.set_val.vals[j], fields[pos]->name);
|
||||
io->Describe(&desc, val->val.set_val.vals[j], fields[pos-1]->name);
|
||||
}
|
||||
|
||||
desc.RemoveEscapeSequence(set_separator);
|
||||
|
@ -330,7 +330,7 @@ int SQLite::AddParams(Value* val, int pos)
|
|||
if ( j > 0 )
|
||||
desc.AddRaw(set_separator);
|
||||
|
||||
io->Describe(&desc, val->val.vector_val.vals[j], fields[pos]->name);
|
||||
io->Describe(&desc, val->val.vector_val.vals[j], fields[pos-1]->name);
|
||||
}
|
||||
|
||||
desc.RemoveEscapeSequence(set_separator);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue