mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03:00
caddyfile: Prevent infinite nesting on fmt (fix #4175)
This commit is contained in:
parent
2dc747cf2d
commit
e6c58fdc08
1 changed files with 4 additions and 1 deletions
|
@ -153,7 +153,10 @@ func Format(input []byte) []byte {
|
||||||
openBraceWritten = true
|
openBraceWritten = true
|
||||||
nextLine()
|
nextLine()
|
||||||
newLines = 0
|
newLines = 0
|
||||||
nesting++
|
// prevent infinite nesting from ridiculous inputs (issue #4175)
|
||||||
|
if nesting < 10 {
|
||||||
|
nesting++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
|
Loading…
Reference in a new issue