File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -108,12 +108,15 @@ func (t *insecureConfigTLS) processTLSConfVal(n *ast.KeyValueExpr, c *gas.Contex
108108}
109109
110110func (t * insecureConfigTLS ) Match (n ast.Node , c * gas.Context ) (* gas.Issue , error ) {
111- if complit , ok := n .(* ast.CompositeLit ); ok && complit .Type != nil && c .Info .TypeOf (complit .Type ).String () == t .requiredType {
112- for _ , elt := range complit .Elts {
113- if kve , ok := elt .(* ast.KeyValueExpr ); ok {
114- issue := t .processTLSConfVal (kve , c )
115- if issue != nil {
116- return issue , nil
111+ if complit , ok := n .(* ast.CompositeLit ); ok && complit .Type != nil {
112+ actualType := c .Info .TypeOf (complit .Type )
113+ if actualType != nil && actualType .String () == t .requiredType {
114+ for _ , elt := range complit .Elts {
115+ if kve , ok := elt .(* ast.KeyValueExpr ); ok {
116+ issue := t .processTLSConfVal (kve , c )
117+ if issue != nil {
118+ return issue , nil
119+ }
117120 }
118121 }
119122 }
You can’t perform that action at this time.
0 commit comments