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

28 lines
459 B
Go

//go:build gc && go1.4
// +build gc,go1.4
package main
import (
"strconv"
)
func testIntSizeIsArchicturallyDependent1() {
{
parsed, err := strconv.ParseInt("3456", 10, 0) // $ Source
if err != nil {
panic(err)
}
_ = int32(parsed) // $ Alert
_ = uint32(parsed) // $ Alert
}
{
parsed, err := strconv.ParseInt("3456", 10, 64) // $ Source
if err != nil {
panic(err)
}
_ = int(parsed) // $ Alert
_ = uint(parsed) // $ Alert
}
}