mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00
fix other instances of GetField().get() assuming long-lived ValPtr's
This commit is contained in:
parent
963d50bd48
commit
84a56e353e
2 changed files with 6 additions and 5 deletions
|
@ -128,12 +128,12 @@ bool File::UpdateConnectionFields(Connection* conn, bool is_orig)
|
|||
if ( ! conn )
|
||||
return false;
|
||||
|
||||
Val* conns = val->GetField(conns_idx).get();
|
||||
auto conns = val->GetField(conns_idx);
|
||||
|
||||
if ( ! conns )
|
||||
{
|
||||
auto ect = empty_connection_table();
|
||||
conns = ect.get();
|
||||
conns = ect;
|
||||
val->Assign(conns_idx, std::move(ect));
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ void File::InferMetadata()
|
|||
{
|
||||
did_metadata_inference = true;
|
||||
|
||||
Val* bof_buffer_val = val->GetField(bof_buffer_idx).get();
|
||||
auto bof_buffer_val = val->GetField(bof_buffer_idx);
|
||||
|
||||
if ( ! bof_buffer_val )
|
||||
{
|
||||
|
@ -318,7 +318,7 @@ void File::InferMetadata()
|
|||
|
||||
String* bs = concatenate(bof_buffer.chunks);
|
||||
val->Assign(bof_buffer_idx, bs);
|
||||
bof_buffer_val = val->GetField(bof_buffer_idx).get();
|
||||
bof_buffer_val = val->GetField(bof_buffer_idx);
|
||||
}
|
||||
|
||||
if ( ! FileEventAvailable(file_sniff) )
|
||||
|
|
|
@ -80,7 +80,8 @@ function Option::set%(ID: string, val: any, location: string &default=""%): bool
|
|||
|
||||
if ( same_type(val->GetType(), zeek::Broker::detail::DataVal::ScriptDataType()) )
|
||||
{
|
||||
auto dv = static_cast<zeek::Broker::detail::DataVal*>(val->AsRecordVal()->GetField(0).get());
|
||||
auto valptr = val->AsRecordVal()->GetField(0);
|
||||
auto dv = static_cast<zeek::Broker::detail::DataVal*>(valptr.get());
|
||||
auto val_from_data = dv->castTo(i->GetType().get());
|
||||
|
||||
if ( ! val_from_data )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue