mirror of
https://github.com/securego/gosec.git
synced 2024-11-06 03:55:50 +00:00
Fix alias logic
This commit is contained in:
parent
c833bfae02
commit
be96ef273d
2 changed files with 2 additions and 4 deletions
|
@ -203,7 +203,7 @@ func (gas *Analyzer) Visit(n ast.Node) ast.Visitor {
|
||||||
gas.context.Imports.InitOnly[path] = true
|
gas.context.Imports.InitOnly[path] = true
|
||||||
} else {
|
} else {
|
||||||
// Aliased import
|
// Aliased import
|
||||||
gas.context.Imports.Aliased[imported.Name.Name] = path
|
gas.context.Imports.Aliased[path] = imported.Name.Name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,7 @@ type WeakRand struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *WeakRand) Match(n ast.Node, c *gas.Context) (*gas.Issue, error) {
|
func (w *WeakRand) Match(n ast.Node, c *gas.Context) (*gas.Issue, error) {
|
||||||
node, _ := gas.MatchCallByPackage(n, c, w.packagePath, w.funcName)
|
if _, matched := gas.MatchCallByPackage(n, c, w.packagePath, w.funcName); matched {
|
||||||
|
|
||||||
if node != nil {
|
|
||||||
return gas.NewIssue(c, n, w.What, w.Severity, w.Confidence), nil
|
return gas.NewIssue(c, n, w.What, w.Severity, w.Confidence), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue