Files
codeql/go/ql/test/query-tests/Security/CWE-312/overrides.go
2025-03-20 15:07:59 +00:00

16 lines
257 B
Go

package main
import "fmt"
type s struct{}
func (_ s) String() string {
password := "horsebatterystaplecorrect"
return password // $ Source
}
func overrideTest(x s, y fmt.Stringer) {
fmt.Println(x.String()) // $ Alert
fmt.Println(y.String()) // OK
}