mirror of
https://github.com/minio/minio.git
synced 2025-01-12 15:33:22 -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
|
apiErr = ErrObjectLockInvalidHeaders
|
||||||
case objectlock.ErrMalformedXML:
|
case objectlock.ErrMalformedXML:
|
||||||
apiErr = ErrMalformedXML
|
apiErr = ErrMalformedXML
|
||||||
|
case errInvalidMaxParts:
|
||||||
|
apiErr = ErrInvalidMaxParts
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compression errors
|
// Compression errors
|
||||||
|
@ -89,6 +89,9 @@ func getOpts(ctx context.Context, r *http.Request, bucket, object string) (Objec
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return opts, err
|
return opts, err
|
||||||
}
|
}
|
||||||
|
if isMaxPartID(partNumber) {
|
||||||
|
return opts, errInvalidMaxParts
|
||||||
|
}
|
||||||
if partNumber <= 0 {
|
if partNumber <= 0 {
|
||||||
return opts, errInvalidArgument
|
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
|
// error returned when upload id not found
|
||||||
var errUploadIDNotFound = errors.New("Specified Upload ID is 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