mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Expr: add missing reference in AssignExpr::InitVal()
The one reference returned by `op2->InitVal()` is given to `aggr_r->Assign()` and returned to the caller, which may result in a use-after-free crash bug. This patch adds the missing reference. Closes https://github.com/zeek/zeek/issues/805
This commit is contained in:
parent
a20dd12117
commit
35d97a24f0
1 changed files with 1 additions and 0 deletions
|
@ -2459,6 +2459,7 @@ Val* AssignExpr::InitVal(const BroType* t, Val* aggr) const
|
||||||
if ( ! v )
|
if ( ! v )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
::Ref(v);
|
||||||
aggr_r->Assign(field, v);
|
aggr_r->Assign(field, v);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue