Skip to content

Commit

Permalink
Change absolute number with INT8_MAX constant
Browse files Browse the repository at this point in the history
  • Loading branch information
CurlyMoo committed Dec 13, 2024
1 parent 4a7749a commit bead5d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rules/rules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2626,7 +2626,8 @@ static int32_t bc_parse_math_order(char **text, struct rules_t *obj, uint16_t *p
}

step = bc_parent(obj, rule_operators[idx].opcode, ++(*cnt), heap_in, d);
if(*cnt > 63) {

if(*cnt > (INT8_MAX/2)) {
logprintf_P(F("ERROR: Too many stacked conditions"));
return -1;
}
Expand Down

0 comments on commit bead5d0

Please sign in to comment.