Skip to content

Commit 55c6cea

Browse files
authored
Fix crash when parsing the TLS min version value (#724)
1 parent 40fa36d commit 55c6cea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rules/tls.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (t *insecureConfigTLS) processTLSConfVal(n *ast.KeyValueExpr, c *gosec.Cont
8888

8989
case "MinVersion":
9090
if d, ok := n.Value.(*ast.Ident); ok {
91-
if vs, ok := d.Obj.Decl.(*ast.ValueSpec); ok {
91+
if vs, ok := d.Obj.Decl.(*ast.ValueSpec); ok && len(vs.Values) > 0 {
9292
if s, ok := vs.Values[0].(*ast.SelectorExpr); ok {
9393
x := s.X.(*ast.Ident).Name
9494
sel := s.Sel.Name

0 commit comments

Comments
 (0)