mirror of
https://github.com/minio/minio.git
synced 2024-12-23 21:55:53 -05:00
s3: Return XMinioInvalidObjectName if the object contains null char (#16372)
This commit is contained in:
parent
57fd02ee57
commit
ebd4388cca
@ -170,6 +170,13 @@ func IsValidObjectPrefix(object string) bool {
|
||||
if strings.Contains(object, `//`) {
|
||||
return false
|
||||
}
|
||||
// This is valid for AWS S3 but it will never
|
||||
// work with file systems, we will reject here
|
||||
// to return object name invalid rather than
|
||||
// a cryptic error from the file system.
|
||||
if strings.ContainsRune(object, 0) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user