Skip to content

Commit aeaaec9

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

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

sql/expression/bit_ops.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ func convertUintFromInt(n int64) uint64 {
189189
if err != nil {
190190
return 0
191191
}
192+
if uintVal > math.MaxInt64 {
193+
return 0 // Out of range for int64
194+
}
192195
return uintVal
193196
}
194197

sql/system_booltype.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func (t systemBoolType) Convert(v interface{}) (interface{}, error) {
108108
return int8(intVal), nil
109109
}
110110
return nil, ErrInvalidSystemVariableValue.New(t.varName, v)
111+
return nil, ErrInvalidSystemVariableValue.New(t.varName, v)
111112
}
112113
return nil, ErrInvalidSystemVariableValue.New(t.varName, v)
113114
}

0 commit comments

Comments
 (0)