Skip to content

Commit 96c5c55

Browse files
authored
admin: fix index validation for PUT requests (#6824)
1 parent 9283770 commit 96c5c55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

admin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ traverseLoop:
11391139
return fmt.Errorf("[%s] invalid array index '%s': %v",
11401140
path, idxStr, err)
11411141
}
1142-
if idx < 0 || idx >= len(arr) {
1142+
if idx < 0 || (method != http.MethodPut && idx >= len(arr)) || idx > len(arr) {
11431143
return fmt.Errorf("[%s] array index out of bounds: %s", path, idxStr)
11441144
}
11451145
}

0 commit comments

Comments
 (0)