Skip to content

Commit

Permalink
Fix integer overflow on 32-bit architectures (#1558)
Browse files Browse the repository at this point in the history
The untyped const causes conversion to int, for which the value is too large.
Use a typed const instead that is large enough to store value.

Similar to #1541, but for v2.2007 branch.
  • Loading branch information
jsoriano authored Oct 12, 2020
1 parent 5e3d4b9 commit f5a7e0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion value.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import (

// maxVlogFileSize is the maximum size of the vlog file which can be created. Vlog Offset is of
// uint32, so limiting at max uint32.
var maxVlogFileSize = math.MaxUint32
var maxVlogFileSize uint32 = math.MaxUint32

// Values have their first byte being byteData or byteDelete. This helps us distinguish between
// a key that has never been seen and a key that has been explicitly deleted.
Expand Down

0 comments on commit f5a7e0a

Please sign in to comment.