@@ -922,7 +922,9 @@ private module Stdlib {
922922 or
923923 // method call
924924 returnsPath .getAttributeName ( ) = pathlibPathMethod ( ) and
925- nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) = returnsPath
925+ returnsPath
926+ .( DataFlow:: LocalSourceNode )
927+ .flowsTo ( nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) )
926928 ) and
927929 nodeFrom = returnsPath .getObject ( )
928930 )
@@ -987,7 +989,7 @@ private module Stdlib {
987989 "unlink" , "link_to" , "write_bytes" , "write_text"
988990 ] and
989991 pathlibPath ( ) .flowsTo ( fileAccess .getObject ( ) ) and
990- this .getFunction ( ) = fileAccess
992+ fileAccess . ( DataFlow :: LocalSourceNode ) . flowsTo ( this .getFunction ( ) )
991993 }
992994
993995 override DataFlow:: Node getAPathArgument ( ) { result = fileAccess .getObject ( ) }
@@ -1022,7 +1024,9 @@ private module Stdlib {
10221024 exists ( DataFlow:: AttrRead augmentsPath |
10231025 augmentsPath .getAttributeName ( ) = pathlibPathInjection ( )
10241026 |
1025- nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) = augmentsPath and
1027+ augmentsPath
1028+ .( DataFlow:: LocalSourceNode )
1029+ .flowsTo ( nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) ) and
10261030 (
10271031 // type-preserving call
10281032 nodeFrom = augmentsPath .getObject ( )
@@ -1042,7 +1046,7 @@ private module Stdlib {
10421046 or
10431047 // exporting method
10441048 exportPath .getAttributeName ( ) = pathlibPathMethodExport ( ) and
1045- nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) = exportPath
1049+ exportPath . ( DataFlow :: LocalSourceNode ) . flowsTo ( nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) )
10461050 |
10471051 nodeFrom = exportPath .getObject ( )
10481052 )
0 commit comments