Merge branch 'topic/corelight/eval-condition-crash' of https://github.com/corelight/bro

* 'topic/corelight/eval-condition-crash' of https://github.com/corelight/bro:
  Fix segmentation fault on eval condition with no return value.
This commit is contained in:
Jon Siwek 2017-10-03 11:56:32 -05:00
commit e7d3dd0818
4 changed files with 34 additions and 2 deletions

View file

@ -175,8 +175,14 @@ 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 )