Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibrahim Jarif committed Jan 14, 2020
1 parent 4127cea commit c9ed8f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,13 @@ func (t *Table) readNoFail(off, sz int) []byte {
func (t *Table) readIndex() error {
readPos := t.tableSize

if readPos <= 0 {
return errors.New("readPos less than zero. Data corrupted")
}
// Read checksum len from the last 4 bytes.
readPos -= 4
buf := t.readNoFail(readPos, 4)
checksumLen := int(y.BytesToU32(buf))
if checksumLen < 0 {
return errors.New("checksum length less than zero. Data corrupted")
}

// Read checksum.
expectedChk := &pb.Checksum{}
Expand Down

0 comments on commit c9ed8f2

Please sign in to comment.