mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Claified the arithmetic behind the max op.value
This commit is contained in:
parent
56659f9d7b
commit
77cb1ea6d8
1 changed files with 4 additions and 1 deletions
|
|
@ -3961,7 +3961,10 @@ func (op *op) UnmarshalBinary(data []byte) error {
|
|||
_, _ = h.Write(data[0:9])
|
||||
|
||||
if op.typ > 1 {
|
||||
if 1152921504606847000 < int(op.value) {
|
||||
// The maximum integer value for a int64 is 9223372036854775807
|
||||
maxInt := 9223372036854775807
|
||||
maxOpValue := maxInt/8-13
|
||||
if maxOpValue < int(op.value) {
|
||||
return fmt.Errorf("too big")
|
||||
}
|
||||
if len(data) < int(13+op.value*8) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue