Add validation of xlMeta ErasureInfo field (#5389)

This commit is contained in:
Nitish Tiwari
2018-01-12 18:16:30 +05:30
committed by GitHub
parent 4b2d04c86f
commit ede504400f
3 changed files with 53 additions and 4 deletions

View File

@@ -269,7 +269,7 @@ func readXLMetaStat(disk StorageAPI, bucket string, object string) (si statInfo,
xlFormat := parseXLFormat(xlMetaBuf)
// Validate if the xl.json we read is sane, return corrupted format.
if !isXLMetaValid(xlVersion, xlFormat) {
if !isXLMetaFormatValid(xlVersion, xlFormat) {
// For version mismatchs and unrecognized format, return corrupted format.
return si, nil, errors2.Trace(errCorruptedFormat)
}