Files
codeql/go/ql/test/experimental/CWE-285/main.go
2026-06-11 07:15:54 +02:00

29 lines
521 B
Go

package main
//go:generate depstubber -vendor github.com/msteinert/pam Style,Transaction StartFunc
import (
"github.com/msteinert/pam"
)
func bad() error {
t, _ := pam.StartFunc("", "", func(s pam.Style, msg string) (string, error) {
return "", nil
}) // $ Alert
return t.Authenticate(0)
}
func good() error {
t, err := pam.StartFunc("", "", func(s pam.Style, msg string) (string, error) {
return "", nil
})
err = t.Authenticate(0)
if err != nil {
return err
}
return t.AcctMgmt(0)
}
func main() {}