Skip to content

Commit fceed0e

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

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sql/system_settype.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ func (t systemSetType) Convert(v interface{}) (interface{}, error) {
9090
// Float values aren't truly accepted, but the engine will give them when it should give ints.
9191
// Therefore, if the float doesn't have a fractional portion, we treat it as an int.
9292
if value == float64(int64(value)) {
93+
if value < float64(math.MinInt64) || value > float64(math.MaxInt64) {
94+
return nil, ErrInvalidSystemVariableValue.New(t.varName, v)
95+
}
9396
return t.SetType.Convert(int64(value))
9497
}
9598
case decimal.Decimal:

0 commit comments

Comments
 (0)