From fcb2cce8a08016e835505dd2b46f9adf24e519a5 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 30 Apr 2021 10:52:45 +0300 Subject: [PATCH] [#278] pkg/client: Fix payload slice allocation in Object Range method Allocate capacity instead of length of the slice to write the object payload range since each chunk is written through `append`. Signed-off-by: Leonard Lyubich --- pkg/client/object.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/client/object.go b/pkg/client/object.go index d970a20..56cbf3c 100644 --- a/pkg/client/object.go +++ b/pkg/client/object.go @@ -874,7 +874,7 @@ func (c *clientImpl) ObjectPayloadRangeData(ctx context.Context, p *RangeDataPar var payload []byte if p.w != nil { - payload = make([]byte, p.r.GetLength()) + payload = make([]byte, 0, p.r.GetLength()) } resp := new(v2object.GetRangeResponse)