Skip to content

Commit 0b15ab6

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

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sql/yeartype.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ func (t yearType) Convert(v interface{}) (interface{}, error) {
106106
return int16(value), nil
107107
}
108108
case uint64:
109+
if value > math.MaxInt64 {
110+
return nil, ErrConvertingToYear.New("uint64 value out of bounds for int64")
111+
}
109112
return t.Convert(int64(value))
110113
case float32:
111114
return t.Convert(int64(value))

0 commit comments

Comments
 (0)