mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix: reused field crash in PartIndices (#15351)
`PartIndices` may be set if xlMetaV2Version is reused. Clear before unmarshaling and add sanity check when reading.
This commit is contained in:
@@ -575,7 +575,7 @@ func (j xlMetaV2Object) ToFileInfo(volume, path string) (FileInfo, error) {
|
||||
fi.Parts[i].ETag = j.PartETags[i]
|
||||
}
|
||||
fi.Parts[i].ActualSize = j.PartActualSizes[i]
|
||||
if len(j.PartIndices) > 0 {
|
||||
if len(j.PartIndices) == len(fi.Parts) {
|
||||
fi.Parts[i].Index = j.PartIndices[i]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user