@@ -62,7 +62,12 @@ module TlsConfigCreationConfig implements DataFlow::ConfigSig {
6262 /**
6363 * Holds if it is TLS.Config instance (a Variable).
6464 */
65- predicate isSink ( DataFlow:: Node sink ) { exists ( Variable v | sink .asExpr ( ) = v .getAReference ( ) ) }
65+ predicate isSink ( DataFlow:: Node sink ) {
66+ exists ( Variable v |
67+ sink .asExpr ( ) = v .getAReference ( ) or
68+ sink .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) = v .getAReference ( )
69+ )
70+ }
6671
6772 /**
6873 * Holds if TLS.Config literal is saved in a structure's field
@@ -87,13 +92,13 @@ predicate configOrConfigPointer(Type t) {
8792 or
8893 exists ( Type tp |
8994 tp .hasQualifiedName ( "crypto/tls" , "Config" ) and
90- t .( NamedType ) .getUnderlyingType ( ) .( StructType ) .hasField ( _, tp )
95+ t .( DefinedType ) .getUnderlyingType ( ) .( StructType ) .hasField ( _, tp )
9196 )
9297 or
9398 exists ( Type tp , Type tp2 |
9499 tp .hasQualifiedName ( "crypto/tls" , "Config" ) and
95100 tp2 = tp .getPointerType + ( ) and
96- t .( NamedType ) .getUnderlyingType ( ) .( StructType ) .hasField ( _, tp2 )
101+ t .( DefinedType ) .getUnderlyingType ( ) .( StructType ) .hasField ( _, tp2 )
97102 )
98103}
99104
@@ -225,7 +230,10 @@ where
225230 // find tls.Config structures with MinVersion not set on the structure initialization
226231 (
227232 TlsConfigCreationFlow:: flow ( source , sink ) and
228- sink .asExpr ( ) = v .getAReference ( ) and
233+ (
234+ sink .asExpr ( ) = v .getAReference ( ) or
235+ sink .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) = v .getAReference ( )
236+ ) and
229237 source .asExpr ( ) = configStruct
230238 ) and
231239 // only explicitely defined, e.g., skip function arguments
0 commit comments