Skip to content

Commit

Permalink
admin: fix index validation for PUT requests (#6824)
Browse files Browse the repository at this point in the history
  • Loading branch information
debug-ing authored Feb 4, 2025
1 parent 9283770 commit 96c5c55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 96c5c55

Please sign in to comment.