Skip to content

Commit

Permalink
Merge pull request #242 from mdmarek/master
Browse files Browse the repository at this point in the history
Respect max depth
  • Loading branch information
epsniff authored May 3, 2021
2 parents 52beec0 + c64ca33 commit e3e4b05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

var (
// MaxDepth acts as a guard against potentially recursive queries
MaxDepth = 100
MaxDepth = 1000
// ErrMaxDepth If we hit max depth on recursion
ErrMaxDepth = fmt.Errorf("Recursive Evaluation Error")
// ErrUnknownOp an unrecognized Operator in expression
Expand Down Expand Up @@ -209,7 +209,7 @@ func resolveInclude(ctx expr.Includer, inc *expr.IncludeNode, depth int) error {
u.Debugf("Includer %T returned a nil filter statement!", inc)
return expr.ErrIncludeNotFound
}
if err = ResolveIncludes(ctx, incExpr); err != nil {
if err = resolveIncludesDepth(ctx, incExpr, depth+1); err != nil {
return err
}
inc.ExprNode = incExpr
Expand Down

0 comments on commit e3e4b05

Please sign in to comment.