From f5a7e0a1c83b7db39381e6e528ae23f21a4dd04f Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 12 Oct 2020 09:26:40 +0200 Subject: [PATCH] Fix integer overflow on 32-bit architectures (#1558) 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. --- value.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/value.go b/value.go index 8aeace3ba..c63b350d3 100644 --- a/value.go +++ b/value.go @@ -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.