From e4e6fdcce0329ce21f40633c2e4bd9210fccde15 Mon Sep 17 00:00:00 2001 From: Mahdi Mohammadi Date: Mon, 3 Feb 2025 18:36:16 +0330 Subject: [PATCH] fix: fix index validation for PUT requests --- admin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin.go b/admin.go index 89fce1d2824..6df5a23f7d7 100644 --- a/admin.go +++ b/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) } }