mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix return value of hook calls that have no handlers.
For this case, the return value is always true.
This commit is contained in:
parent
4a09c12882
commit
98663fd534
2 changed files with 2 additions and 1 deletions
|
@ -288,7 +288,7 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
|
|||
assert(Flavor() == FUNC_FLAVOR_EVENT || Flavor() == FUNC_FLAVOR_HOOK);
|
||||
loop_over_list(*args, i)
|
||||
Unref((*args)[i]);
|
||||
return 0 ;
|
||||
return Flavor() == FUNC_FLAVOR_HOOK ? new Val(true, TYPE_BOOL) : 0;
|
||||
}
|
||||
|
||||
SegmentProfiler(segment_logger, location);
|
||||
|
|
|
@ -3,6 +3,7 @@ myhook return F
|
|||
myhook return T
|
||||
myhook, &priority=5, [a=37, b=goobye world]
|
||||
F
|
||||
T
|
||||
myhook3, 8
|
||||
T
|
||||
myhook4, 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue