"0" offset is ignored in GetObject method in Azure Gateway code (#5118)

In GetObject method, Check if startoffset is a non-negative value.
Ignore check for startOffset > and check for only length > 0.

Fixes minio/mint#191
master
kannappanr 7 years ago committed by Dee Koder
parent 95d97c2d6d
commit a011fe8450
  1. 7
      cmd/gateway-azure.go

@ -469,8 +469,13 @@ func (a *azureObjects) ListObjectsV2(bucket, prefix, continuationToken, delimite
// startOffset indicates the starting read location of the object.
// length indicates the total length of the object.
func (a *azureObjects) GetObject(bucket, object string, startOffset int64, length int64, writer io.Writer) error {
// startOffset cannot be negative.
if startOffset < 0 {
return toObjectErr(traceError(errUnexpected), bucket, object)
}
blobRange := &storage.BlobRange{Start: uint64(startOffset)}
if length > 0 && startOffset > 0 {
if length > 0 {
blobRange.End = uint64(startOffset + length - 1)
}

Loading…
Cancel
Save