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.
master
Anis Elleuch 6 years ago committed by kannappanr
parent ca6f795504
commit 66d911653f
  1. 2
      cmd/xl-v1-multipart.go

@ -359,7 +359,7 @@ func (xl xlObjects) PutObjectPart(ctx context.Context, bucket, object, uploadID
switch size := data.Size(); { switch size := data.Size(); {
case size == 0: case size == 0:
buffer = make([]byte, 1) // Allocate atleast a byte to reach EOF 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() buffer = xl.bp.Get()
defer xl.bp.Put(buffer) defer xl.bp.Put(buffer)
case size < blockSizeV1: case size < blockSizeV1:

Loading…
Cancel
Save