mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
verify maxPartID in object options helpers (#17015)
This commit is contained in:
parent
224d9a752f
commit
8a81e317d6
@ -2097,6 +2097,8 @@ func toAPIErrorCode(ctx context.Context, err error) (apiErr APIErrorCode) {
|
||||
apiErr = ErrObjectLockInvalidHeaders
|
||||
case objectlock.ErrMalformedXML:
|
||||
apiErr = ErrMalformedXML
|
||||
case errInvalidMaxParts:
|
||||
apiErr = ErrInvalidMaxParts
|
||||
}
|
||||
|
||||
// Compression errors
|
||||
|
@ -89,6 +89,9 @@ func getOpts(ctx context.Context, r *http.Request, bucket, object string) (Objec
|
||||
if err != nil {
|
||||
return opts, err
|
||||
}
|
||||
if isMaxPartID(partNumber) {
|
||||
return opts, errInvalidMaxParts
|
||||
}
|
||||
if partNumber <= 0 {
|
||||
return opts, errInvalidArgument
|
||||
}
|
||||
|
@ -112,3 +112,6 @@ var errIAMNotInitialized = errors.New("IAM sub-system is being initialized, plea
|
||||
|
||||
// error returned when upload id not found
|
||||
var errUploadIDNotFound = errors.New("Specified Upload ID is not found")
|
||||
|
||||
// error returned when PartNumber is greater than the maximum allowed 10000 parts
|
||||
var errInvalidMaxParts = errors.New("Part number is greater than the maximum allowed 10000 parts")
|
||||
|
Loading…
Reference in New Issue
Block a user