mirror of
https://github.com/securego/gosec.git
synced 2024-11-05 19:45:51 +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
|
||||
} else {
|
||||
// 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) {
|
||||
node, _ := gas.MatchCallByPackage(n, c, w.packagePath, w.funcName)
|
||||
|
||||
if node != nil {
|
||||
if _, matched := gas.MatchCallByPackage(n, c, w.packagePath, w.funcName); matched {
|
||||
return gas.NewIssue(c, n, w.What, w.Severity, w.Confidence), nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue