Skip to content

Commit b8dc304

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

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sql/plan/insert.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package plan
1717
import (
1818
"fmt"
1919
"io"
20+
"math"
2021
"strings"
2122

2223
"github.com/dolthub/vitess/go/vt/proto/query"
@@ -657,6 +658,9 @@ func toInt64(x interface{}) int64 {
657658
case int64:
658659
return x
659660
case uint64:
661+
if x > math.MaxInt64 {
662+
panic(fmt.Sprintf("Value %d exceeds int64 range", x))
663+
}
660664
return int64(x)
661665
case float32:
662666
return int64(x)

0 commit comments

Comments
 (0)