[#1175] core/object: Check emptiness of `LOCK` members

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/fyrchik/fix-lock
Leonard Lyubich 2022-03-11 10:24:44 +03:00 committed by LeL
parent 9feb5f9405
commit 98c84670e3
1 changed files with 6 additions and 1 deletions

View File

@ -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)