xl: Fix typo in PutObject when uploading a 10Mb file (#6567)

PutObject forgot to allocate memory when the size of the uploaded
file is exactly equal to blockSizeV1 = 10 Mb.
master
Anis Elleuch 6 years ago committed by Harshavardhana
parent c2b7b82ef4
commit e031f2b614
  1. 2
      cmd/xl-v1-object.go

@ -686,7 +686,7 @@ func (xl xlObjects) putObject(ctx context.Context, bucket string, object string,
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:

Loading…
Cancel
Save