Skip to content

Commit

Permalink
Merge pull request securego#110 from GoASTScanner/bugfix
Browse files Browse the repository at this point in the history
Improve specitivity of error message for GenDecl
  • Loading branch information
gcmurphy committed Jan 11, 2017
2 parents 0545d13 + d1303fe commit bc21a39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rules/hardcoded_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (r *Credentials) matchGenDecl(decl *ast.GenDecl, ctx *gas.Context) (*gas.Is
index = len(valueSpec.Values) - 1
}
if rhs, ok := valueSpec.Values[index].(*ast.BasicLit); ok && rhs.Kind == token.STRING {
return gas.NewIssue(ctx, decl, r.What, r.Severity, r.Confidence), nil
return gas.NewIssue(ctx, valueSpec, r.What, r.Severity, r.Confidence), nil
}
}
}
Expand Down

0 comments on commit bc21a39

Please sign in to comment.