mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-24 23:57:05 -05:00
admin: fix index validation for PUT requests (#6824)
This commit is contained in:
parent
9283770f68
commit
96c5c554c1
1 changed files with 1 additions and 1 deletions
2
admin.go
2
admin.go
|
@ -1139,7 +1139,7 @@ traverseLoop:
|
|||
return fmt.Errorf("[%s] invalid array index '%s': %v",
|
||||
path, idxStr, err)
|
||||
}
|
||||
if idx < 0 || idx >= len(arr) {
|
||||
if idx < 0 || (method != http.MethodPut && idx >= len(arr)) || idx > len(arr) {
|
||||
return fmt.Errorf("[%s] array index out of bounds: %s", path, idxStr)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue