From aa0cc1f824036385fce97db884513ec4959b9c53 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 3 Mar 2022 17:18:52 +0300 Subject: [PATCH] [#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 --- pkg/local_object_storage/blobovnicza/get.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/local_object_storage/blobovnicza/get.go b/pkg/local_object_storage/blobovnicza/get.go index 10eb55b6..d15dd559 100644 --- a/pkg/local_object_storage/blobovnicza/get.go +++ b/pkg/local_object_storage/blobovnicza/get.go @@ -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