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:
Johanna Amann 2017-09-19 09:23:09 -07:00
parent fc33bf2014
commit 5243a054ef
4 changed files with 33 additions and 2 deletions

View file

@ -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 )