egg

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 178cce37a1f0fdd49a0bb11fcc2ea16ca38ae7b9
parent 1f9aac3d87441c9c99e52ac5e7d7f29a60326bbb
Author: Gabriel G. de Brito <gabrielgbrito@icloud.com>
Date:   Thu, 18 Apr 2024 19:33:56 -0300

Fix immediate size check in translateArgs function to satisfy CodeQL

Diffstat:
Msagui/sagui.go | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/sagui/sagui.go b/sagui/sagui.go @@ -196,6 +196,9 @@ func translateArgs(arg string) (uint64, error) { reg, err := getRegisterNumber(arg) if err != nil { n, err := strconv.ParseInt(arg, 0, 64) + if n > 0xf { + return 0, fmt.Errorf("immediate bigger than immediate size: %v", arg) + } return uint64(n), err } return reg, nil