From 98c84670e31460534fc75ff1757453e9ca6560cf Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 11 Mar 2022 10:24:44 +0300 Subject: [PATCH] [#1175] core/object: Check emptiness of `LOCK` members Signed-off-by: Leonard Lyubich --- pkg/core/object/fmt.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/core/object/fmt.go b/pkg/core/object/fmt.go index dec93d479..80a258561 100644 --- a/pkg/core/object/fmt.go +++ b/pkg/core/object/fmt.go @@ -227,8 +227,13 @@ func (v *FormatValidator) ValidateContent(o *object.Object) error { } if v.locker != nil { + num := lock.NumberOfMembers() + if num == 0 { + return errors.New("missing locked members") + } + // mark all objects from lock list as locked in storage engine - locklist := make([]oid.ID, lock.NumberOfMembers()) + locklist := make([]oid.ID, num) lock.ReadMembers(locklist) err = v.locker.Lock(*o.ContainerID(), *o.ID(), locklist)