mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 12:05:52 +00:00
commit
7dd3032823
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