From 66d911653f17b9b180493e3e21c6131170741dcf Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Sat, 6 Oct 2018 01:09:50 +0100 Subject: [PATCH] xl: Fix typo in PutObjectPart when part size is 10Mb (#6574) PutObjectPart forgot to allocate buffer memory when the size of the uploaded part is exactly equal to blockSizeV1 = 10 Mb. --- cmd/xl-v1-multipart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/xl-v1-multipart.go b/cmd/xl-v1-multipart.go index 63de4a546..29a9ee45f 100644 --- a/cmd/xl-v1-multipart.go +++ b/cmd/xl-v1-multipart.go @@ -359,7 +359,7 @@ func (xl xlObjects) PutObjectPart(ctx context.Context, bucket, object, uploadID switch size := data.Size(); { case size == 0: buffer = make([]byte, 1) // Allocate atleast a byte to reach EOF - case size == -1 || size > blockSizeV1: + case size == -1 || size >= blockSizeV1: buffer = xl.bp.Get() defer xl.bp.Put(buffer) case size < blockSizeV1: