Limit how much blocks can be nested during parsing (#894)

This commit is contained in:
Dylan Thacker-Smith
2017-05-11 09:37:53 -04:00
committed by GitHub
parent 62d4625468
commit 9c72ccb82f
5 changed files with 37 additions and 12 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ module Liquid
# Push new local scope on the stack. use <tt>Context#stack</tt> instead
def push(new_scope = {})
@scopes.unshift(new_scope)
raise StackLevelError, "Nesting too deep".freeze if @scopes.length > 100
raise StackLevelError, "Nesting too deep".freeze if @scopes.length > Block::MAX_DEPTH
end
# Merge a hash of variables in the current local scope