mirror of
https://github.com/caddyserver/caddy.git
synced 2025-04-24 05:44:04 +08:00
fix: fix index validation for PUT requests
This commit is contained in:
parent
9996d6a70b
commit
e4e6fdcce0
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…
x
Reference in New Issue
Block a user