Skip to content

Commit 298753c

Browse files
Potential fix for code scanning alert no. 284: Incorrect conversion between integer types
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent a1d1fe6 commit 298753c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sql/system_inttype.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ func (t systemIntType) Convert(v interface{}) (interface{}, error) {
9292
return value, nil
9393
}
9494
case uint64:
95-
return t.Convert(int64(value))
95+
if value <= math.MaxInt64 {
96+
return t.Convert(int64(value))
97+
}
98+
return nil, ErrInvalidSystemVariableValue.New(t.varName, v)
9699
case float32:
97100
return t.Convert(float64(value))
98101
case float64:

0 commit comments

Comments
 (0)