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

27 lines
411 B
Go

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