From a011fe84503b2af9d4ba637441adc4c9a95fa787 Mon Sep 17 00:00:00 2001 From: kannappanr <30541348+kannappanr@users.noreply.github.com> Date: Thu, 26 Oct 2017 18:01:46 -0700 Subject: [PATCH] "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 --- cmd/gateway-azure.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/gateway-azure.go b/cmd/gateway-azure.go index 5718f856e..12eb442b5 100644 --- a/cmd/gateway-azure.go +++ b/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) }