mirror of
https://github.com/caddyserver/caddy.git
synced 2026-01-12 17:39:06 -05:00
caddyfile: Prevent infinite nesting on fmt (fix #4175)
This commit is contained in:
@@ -153,7 +153,10 @@ func Format(input []byte) []byte {
|
||||
openBraceWritten = true
|
||||
nextLine()
|
||||
newLines = 0
|
||||
nesting++
|
||||
// prevent infinite nesting from ridiculous inputs (issue #4175)
|
||||
if nesting < 10 {
|
||||
nesting++
|
||||
}
|
||||
}
|
||||
|
||||
switch {
|
||||
|
||||
Reference in New Issue
Block a user