[#1143] blobovnicza: Copy object data in Get

Data returned from `*bbolt.Bucket.Get()` is only valid for the lifetime
of the transaction.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-03-03 17:18:52 +03:00 committed by fyrchik
parent 6472a170eb
commit aa0cc1f824

View file

@ -1,6 +1,7 @@
package blobovnicza
import (
"github.com/nspcc-dev/neo-go/pkg/util/slice"
apistatus "github.com/nspcc-dev/neofs-sdk-go/client/status"
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
"go.etcd.io/bbolt"
@ -51,6 +52,7 @@ func (b *Blobovnicza) Get(prm *GetPrm) (*GetRes, error) {
zap.String("binary size", stringifyByteSize(uint64(len(data)))),
zap.String("range", stringifyBounds(lower, upper)),
)
data = slice.Copy(data)
}
return stop, nil