@@ -946,7 +946,11 @@ private module Stdlib {
946
946
slash .getOp ( ) instanceof Div and
947
947
right .asCfgNode ( ) = slash .getRight ( ) and
948
948
left .asCfgNode ( ) = slash .getLeft ( ) and
949
- left .getALocalSource ( ) = pathlibPath ( t2 ) and
949
+ (
950
+ left .getALocalSource ( ) = pathlibPath ( t2 )
951
+ or
952
+ right .getALocalSource ( ) = pathlibPath ( t2 )
953
+ ) and
950
954
t2 .end ( )
951
955
|
952
956
t .start ( ) and
@@ -1030,19 +1034,24 @@ private module Stdlib {
1030
1034
nodeTo .getALocalSource ( ) = pathlibPath ( ) and
1031
1035
(
1032
1036
// Special handling of the `/` operator
1033
- exists ( BinaryExprNode slash , DataFlow:: Node left |
1037
+ exists ( BinaryExprNode slash , DataFlow:: Node path_operand , DataFlow :: Node data_operand |
1034
1038
slash .getOp ( ) instanceof Div and
1035
- left .asCfgNode ( ) = slash .getLeft ( ) and
1036
- left .getALocalSource ( ) = pathlibPath ( )
1037
- |
1038
- nodeTo .asCfgNode ( ) = slash and
1039
1039
(
1040
- // type-preserving call
1041
- nodeFrom = left
1040
+ path_operand . asCfgNode ( ) = slash . getLeft ( ) and
1041
+ data_operand . asCfgNode ( ) = slash . getRight ( )
1042
1042
or
1043
- // data injection
1044
- nodeFrom .asCfgNode ( ) = slash .getRight ( )
1045
- )
1043
+ path_operand .asCfgNode ( ) = slash .getRight ( ) and
1044
+ data_operand .asCfgNode ( ) = slash .getLeft ( )
1045
+ ) and
1046
+ path_operand .getALocalSource ( ) = pathlibPath ( )
1047
+ |
1048
+ nodeTo .asCfgNode ( ) = slash and
1049
+ nodeFrom in [
1050
+ // type-preserving call
1051
+ path_operand ,
1052
+ // data injection
1053
+ data_operand
1054
+ ]
1046
1055
)
1047
1056
or
1048
1057
// standard case
0 commit comments