From 80f1bdebd7a592a8199dcedd143e8ad4ff51ca41 Mon Sep 17 00:00:00 2001 From: Travis Date: Wed, 15 Apr 2020 15:50:03 -0500 Subject: [PATCH] error on potential overflow --- executor.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/executor.go b/executor.go index f810f189c..a78735755 100644 --- a/executor.go +++ b/executor.go @@ -4596,6 +4596,9 @@ func getScaledInt(f *Field, v interface{}) (int64, error) { if opt.Type == FieldTypeDecimal { switch tv := v.(type) { case uint64: + if tv > math.MaxInt64 { + return 0, errors.Errorf("uint64 value out of range for pql.Decimal: %d", tv) + } dec := pql.NewDecimal(int64(tv), 0) value = decimalToInt64(dec, opt) case int64: