Files
codeql/go/ql/test/query-tests/Security/CWE-681/Test32BitArchitectureBuildConstraintInFileName_386.go
2025-06-24 14:57:48 +02:00

35 lines
538 B
Go

// Note that the filename acts as an implicit build constraint
package main
import (
"strconv"
)
func testIntSource386() {
{
parsed, err := strconv.ParseInt("3456", 10, 0)
if err != nil {
panic(err)
}
_ = int32(parsed)
_ = uint32(parsed)
}
{
parsed, err := strconv.ParseUint("3456", 10, 0) // $ Source
if err != nil {
panic(err)
}
_ = int32(parsed) // $ Alert
_ = uint32(parsed)
}
{
parsed, err := strconv.Atoi("3456")
if err != nil {
panic(err)
}
_ = int32(parsed)
_ = uint32(parsed)
}
}