mirror of
https://github.com/securego/gosec.git
synced 2025-11-27 22:28:20 +02:00
Fix crash when parsing the TLS min version value (#724)
This commit is contained in:
@@ -88,7 +88,7 @@ func (t *insecureConfigTLS) processTLSConfVal(n *ast.KeyValueExpr, c *gosec.Cont
|
|||||||
|
|
||||||
case "MinVersion":
|
case "MinVersion":
|
||||||
if d, ok := n.Value.(*ast.Ident); ok {
|
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 {
|
if s, ok := vs.Values[0].(*ast.SelectorExpr); ok {
|
||||||
x := s.X.(*ast.Ident).Name
|
x := s.X.(*ast.Ident).Name
|
||||||
sel := s.Sel.Name
|
sel := s.Sel.Name
|
||||||
|
|||||||
Reference in New Issue
Block a user