mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
GH-1503: Improve &expire_func compatibility type-checking
Previously, incompatible &expire_funcs could mistakenly be used, such as when using that attribute on the unspecified table()/set() initializations/assignments, resulting in invalid function calls that eventually crash Zeek.
This commit is contained in:
parent
0c93e2fcb8
commit
01f6264c87
6 changed files with 85 additions and 46 deletions
|
@ -1502,7 +1502,12 @@ void TableVal::SetAttrs(detail::AttributesPtr a)
|
|||
const auto& ef = attrs->Find(detail::ATTR_EXPIRE_FUNC);
|
||||
|
||||
if ( ef )
|
||||
expire_func = ef->GetExpr();
|
||||
{
|
||||
if ( GetType()->AsTableType()->CheckExpireFuncCompatibility(ef) )
|
||||
expire_func = ef->GetExpr();
|
||||
else
|
||||
expire_func = nullptr;
|
||||
}
|
||||
|
||||
const auto& cf = attrs->Find(detail::ATTR_ON_CHANGE);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue