Skip to content

Commit

Permalink
fix: incorrect execution flow when rule checks returned false for a g…
Browse files Browse the repository at this point in the history
…iven rule.

When a check returned false, all remaining rules for that screen were
skipped.  Instead, the current rule should be skipped and continue with the
next one.  Replace a "return;" with a "goto next_rule;"
  • Loading branch information
jorgegv committed Feb 5, 2021
1 parent 65fa443 commit 7cd3eba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engine/src/flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ void run_flow_rule_table( struct flow_rule_table_s *t ) {
for ( j = 0; j < r->num_checks; j++ ) {
check = &r->checks[j];
if ( ! rule_check_fn[ check->type ]( check ) )
return;
goto next_rule;
}
// if we reach here, all checks were true; run the actions in order
for ( j = 0; j < r->num_actions; j++ ) {
action = &r->actions[j];
rule_action_fn[ action->type ]( action );
}
next_rule:
}
}

Expand Down

0 comments on commit 7cd3eba

Please sign in to comment.