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:
@@ -83,6 +83,10 @@ func (j *xlMetaV2Version) unmarshalV(v uint8, bts []byte) (o []byte, err error)
|
||||
switch v {
|
||||
// We accept un-set as latest version.
|
||||
case 0, xlMetaVersion:
|
||||
// Clear omitempty fields:
|
||||
if j.ObjectV2 != nil && len(j.ObjectV2.PartIndices) > 0 {
|
||||
j.ObjectV2.PartIndices = j.ObjectV2.PartIndices[:0]
|
||||
}
|
||||
o, err = j.UnmarshalMsg(bts)
|
||||
|
||||
// Clean up PartEtags on v1
|
||||
|
||||
Reference in New Issue
Block a user