mirror of
https://github.com/securego/gosec.git
synced 2025-11-23 22:15:04 +02:00
Fix the call list info to handle selector expressions
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
This commit is contained in:
committed by
Cosmin Cojocar
parent
cf2590442c
commit
7da9f46445
@@ -135,6 +135,14 @@ func GetCallInfo(n ast.Node, ctx *Context) (string, string, error) {
|
||||
return "undefined", fn.Sel.Name, fmt.Errorf("missing type info")
|
||||
}
|
||||
return expr.Name, fn.Sel.Name, nil
|
||||
case *ast.SelectorExpr:
|
||||
if expr.Sel != nil {
|
||||
t := ctx.Info.TypeOf(expr.Sel)
|
||||
if t != nil {
|
||||
return t.String(), fn.Sel.Name, nil
|
||||
}
|
||||
return "undefined", fn.Sel.Name, fmt.Errorf("missing type info")
|
||||
}
|
||||
case *ast.CallExpr:
|
||||
switch call := expr.Fun.(type) {
|
||||
case *ast.Ident:
|
||||
|
||||
Reference in New Issue
Block a user