Skip to content

Commit c066795

Browse files
committed
Prevent overflow for large db on 32-bit CPU
The record size is always divisible by 4.
1 parent f4767f1 commit c066795

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func FromBytes(buffer []byte) (*Reader, error) {
6565
return nil, err
6666
}
6767

68-
searchTreeSize := metadata.NodeCount * metadata.RecordSize / 4
68+
searchTreeSize := metadata.NodeCount * (metadata.RecordSize / 4)
6969
dataSectionStart := searchTreeSize + dataSectionSeparatorSize
7070
dataSectionEnd := uint(metadataStart - len(metadataStartMarker))
7171
if dataSectionStart > dataSectionEnd {

0 commit comments

Comments
 (0)