More CodeQL fixes

This commit is contained in:
Kovid Goyal
2025-04-20 21:53:11 +05:30
parent adfcffa5d7
commit 237bb35ee9
6 changed files with 25 additions and 14 deletions

View File

@@ -4,6 +4,7 @@ package loop
import (
"fmt"
"math"
"strconv"
"strings"
@@ -152,7 +153,7 @@ func KeyEventFromCSI(csi string) *KeyEvent {
ans[i] = missing
} else {
q, err := strconv.ParseUint(x, 10, 32)
if err != nil {
if err != nil || q > math.MaxInt32 {
return nil
}
ans[i] = int32(q)