Skip to content

Commit

Permalink
Revert "Revert "add assert to check integer overflow for table size (#…
Browse files Browse the repository at this point in the history
…1402)" (#1406)"

This reverts commit e0d058c.
  • Loading branch information
Ibrahim Jarif committed Aug 14, 2020
1 parent 233be8e commit 378491d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions table/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ func (b *Builder) shouldFinishBlock(key []byte, value y.ValueStruct) bool {
// So, size of IV is added to estimatedSize.
estimatedSize += aes.BlockSize
}
// Integer overflow check for table size.
y.AssertTrue(uint64(b.sz)+uint64(estimatedSize) < math.MaxUint32)

return estimatedSize > uint32(b.opt.BlockSize)
}

Expand Down

0 comments on commit 378491d

Please sign in to comment.