From 3a3473df66796bb92fe17e6925eb9e1bfba4ac96 Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Wed, 9 Aug 2023 11:02:34 +0300 Subject: [PATCH] fix(blob): ensure that the share sequence is not empty (#2547) --- blob/helper.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blob/helper.go b/blob/helper.go index 35f0abc540..e87055ae07 100644 --- a/blob/helper.go +++ b/blob/helper.go @@ -32,6 +32,11 @@ func SharesToBlobs(rawShares []share.Share) ([]*Blob, error) { return nil, err } + // ensure that sequence length is not 0 + if len(shareSequences) == 0 { + return nil, ErrBlobNotFound + } + blobs := make([]*Blob, len(shareSequences)) for i, sequence := range shareSequences { data, err := sequence.RawData()