mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
![]() Currently, Zeek disables any static type checking for var_arg bifs. However, the generated preamble for var_args bifs assume that typed positional arguments are correctly typed and blindly calls the type converters on them. This easily triggers abort()s at runtime currently when a script mistakenly uses the wrong types for var_arg bifs. For example, calling publish_rr() with a port instead of a string causes a hard-abort with Zeek 5.0.8. $ zeek -e 'Cluster::publish_rr(Cluster::Pool(), 80/tcp)' fatal error in <no location>: Val::CONVERTER (port/string) (80/tcp) Aborted (core dumped) Extend bifcl so that for var_arg functions and the types that bifcl understands, we render a runtime type check and explicit early return to avoid the abort(). For any/other types, the implementer of the bif continuous to be responsible for type checking. This isn't solving the var_args situation generally, but avoids some ad-hoc fixes trickling in current bif implementations. Some references: https://github.com/zeek/zeek/issues/1523 https://github.com/zeek/zeek/issues/2425 https://github.com/zeek/zeek/issues/2935 https://github.com/zeek/zeek/pull/2950 |
||
---|---|---|
.. | ||
bif_arg.h | ||
bif_type.def | ||
module_util.h |