Skip to content
Permalink
Browse files Browse the repository at this point in the history
Make sure that loop depth is greater than 0 before decrementing it.
  • Loading branch information
plusvic committed Jan 9, 2017
1 parent d16868f commit 7f02eca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libyara/grammar.y
Expand Up @@ -1017,8 +1017,11 @@ expression
}
| _FOR_ for_expression error
{
compiler->loop_depth--;
compiler->loop_identifier[compiler->loop_depth] = NULL;
if (compiler->loop_depth > 0)
{
compiler->loop_depth--;
compiler->loop_identifier[compiler->loop_depth] = NULL;
}
}
| _FOR_ for_expression _IDENTIFIER_ _IN_
{
Expand Down

0 comments on commit 7f02eca

Please sign in to comment.