diff --git a/rules/tls.go b/rules/tls.go index 486b56e3cb..55a6786ad0 100644 --- a/rules/tls.go +++ b/rules/tls.go @@ -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