@@ -922,7 +922,9 @@ private module Stdlib {
922
922
or
923
923
// method call
924
924
returnsPath .getAttributeName ( ) = pathlibPathMethod ( ) and
925
- nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) = returnsPath
925
+ returnsPath
926
+ .( DataFlow:: LocalSourceNode )
927
+ .flowsTo ( nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) )
926
928
) and
927
929
nodeFrom = returnsPath .getObject ( )
928
930
)
@@ -987,7 +989,7 @@ private module Stdlib {
987
989
"unlink" , "link_to" , "write_bytes" , "write_text"
988
990
] and
989
991
pathlibPath ( ) .flowsTo ( fileAccess .getObject ( ) ) and
990
- this .getFunction ( ) = fileAccess
992
+ fileAccess . ( DataFlow :: LocalSourceNode ) . flowsTo ( this .getFunction ( ) )
991
993
}
992
994
993
995
override DataFlow:: Node getAPathArgument ( ) { result = fileAccess .getObject ( ) }
@@ -1022,7 +1024,9 @@ private module Stdlib {
1022
1024
exists ( DataFlow:: AttrRead augmentsPath |
1023
1025
augmentsPath .getAttributeName ( ) = pathlibPathInjection ( )
1024
1026
|
1025
- nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) = augmentsPath and
1027
+ augmentsPath
1028
+ .( DataFlow:: LocalSourceNode )
1029
+ .flowsTo ( nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) ) and
1026
1030
(
1027
1031
// type-preserving call
1028
1032
nodeFrom = augmentsPath .getObject ( )
@@ -1042,7 +1046,7 @@ private module Stdlib {
1042
1046
or
1043
1047
// exporting method
1044
1048
exportPath .getAttributeName ( ) = pathlibPathMethodExport ( ) and
1045
- nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) = exportPath
1049
+ exportPath . ( DataFlow :: LocalSourceNode ) . flowsTo ( nodeTo .( DataFlow:: CallCfgNode ) .getFunction ( ) )
1046
1050
|
1047
1051
nodeFrom = exportPath .getObject ( )
1048
1052
)
0 commit comments