gcs: fix constant overflow for 32-bit systems
This commit is contained in:
parent
18097a52c4
commit
e14ee486e6
1 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@ import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"math"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/aead/siphash"
|
"github.com/aead/siphash"
|
||||||
|
@ -60,7 +61,7 @@ func BuildGCSFilter(P uint8, key [KeySize]byte, data [][]byte) (*Filter, error)
|
||||||
if len(data) == 0 {
|
if len(data) == 0 {
|
||||||
return nil, ErrNoData
|
return nil, ErrNoData
|
||||||
}
|
}
|
||||||
if len(data) > ((1 << 32) - 1) {
|
if len(data) > math.MaxInt32 {
|
||||||
return nil, ErrNTooBig
|
return nil, ErrNTooBig
|
||||||
}
|
}
|
||||||
if P > 32 {
|
if P > 32 {
|
||||||
|
|
Loading…
Reference in a new issue