Skip to content

Commit

Permalink
Fix crash when parsing the TLS min version value (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccojocar authored Nov 9, 2021
1 parent 40fa36d commit 55c6cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rules/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (t *insecureConfigTLS) processTLSConfVal(n *ast.KeyValueExpr, c *gosec.Cont

case "MinVersion":
if d, ok := n.Value.(*ast.Ident); ok {
if vs, ok := d.Obj.Decl.(*ast.ValueSpec); ok {
if vs, ok := d.Obj.Decl.(*ast.ValueSpec); ok && len(vs.Values) > 0 {
if s, ok := vs.Values[0].(*ast.SelectorExpr); ok {
x := s.X.(*ast.Ident).Name
sel := s.Sel.Name
Expand Down

0 comments on commit 55c6cea

Please # to comment.