Skip to content

Commit

Permalink
fix(object): partNumber must not be greater than 10000
Browse files Browse the repository at this point in the history
Signed-off-by: yhjiango <[email protected]>
  • Loading branch information
yhjiango authored and tangdeyi committed Mar 6, 2024
1 parent 1f23b3f commit 234d30e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions objectnode/api_handler_multipart.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,6 @@ func (o *ObjectNode) checkReqParts(param *RequestParam, reqParts *CompleteMultip
}

for idx, reqPart := range reqParts.Parts {
if reqPart.PartNumber > len(multipartInfo.Parts) {
err = InvalidPart
return
}
if multipartInfo.Parts[reqPart.PartNumber-1].Size < MinPartSizeBytes && idx < len(reqParts.Parts)-1 {
err = EntityTooSmall
return
Expand Down Expand Up @@ -698,7 +694,7 @@ func (o *ObjectNode) completeMultipartUploadHandler(w http.ResponseWriter, r *ht
}
previousPartNum := 0
for _, p := range multipartUploadRequest.Parts {
if p.PartNumber < 1 {
if p.PartNumber < MinPartNumberValid || p.PartNumber > MaxPartNumberValid {
log.LogErrorf("completeMultipartUploadHandler: invalid part number: requestID(%v) partNum=%d",
GetRequestID(r), p.PartNumber)
errorCode = InvalidPartNumber
Expand Down

0 comments on commit 234d30e

Please sign in to comment.