Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/rules/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,18 +601,20 @@ static unsigned int reduceExpressionSequence(ruleset *tree,
messageObject,
context,
targetProperty));
++*i;
++*i; // increment to next expression makes currentExpression invalid
}

if (targetProperty->type != JSON_BOOL) {
return ERR_OPERATION_NOT_SUPPORTED;
}


if ((operator == OP_AND && !targetProperty->value.b) ||
(operator == OP_OR && targetProperty->value.b)) {
while (currentExpression->operator != OP_END) {
++*i;
if ((((operator == OP_AND) && !targetProperty->value.b) ||
((operator == OP_OR) && targetProperty->value.b))
&& (*i < exprs->length)) {
// after reduceExpression() index i moved on to next currentExpression
currentExpression = &exprs->expressions[*i];
while ((currentExpression->operator != OP_END) && (++*i < exprs->length)) {
currentExpression = &exprs->expressions[*i];
}
return RULES_OK;
Expand Down