mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Fix segmentation fault on eval condition with no return value.
Signatures using an eval-condition that had no return value caused a segmentation fault. This fix just returns false in this case, as it is done for an interpreter error.
This commit is contained in:
parent
fc33bf2014
commit
5243a054ef
4 changed files with 33 additions and 2 deletions
|
@ -175,8 +175,13 @@ bool RuleConditionEval::DoMatch(Rule* rule, RuleEndpointState* state,
|
|||
try
|
||||
{
|
||||
Val* val = id->ID_Val()->AsFunc()->Call(&args);
|
||||
result = val->AsBool();
|
||||
Unref(val);
|
||||
if ( val )
|
||||
{
|
||||
result = val->AsBool();
|
||||
Unref(val);
|
||||
}
|
||||
else
|
||||
result = false;
|
||||
}
|
||||
|
||||
catch ( InterpreterException& e )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue