@@ -946,7 +946,11 @@ private module Stdlib {
946946 slash .getOp ( ) instanceof Div and
947947 right .asCfgNode ( ) = slash .getRight ( ) and
948948 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
950954 t2 .end ( )
951955 |
952956 t .start ( ) and
@@ -1030,19 +1034,24 @@ private module Stdlib {
10301034 nodeTo .getALocalSource ( ) = pathlibPath ( ) and
10311035 (
10321036 // Special handling of the `/` operator
1033- exists ( BinaryExprNode slash , DataFlow:: Node left |
1037+ exists ( BinaryExprNode slash , DataFlow:: Node path_operand , DataFlow :: Node data_operand |
10341038 slash .getOp ( ) instanceof Div and
1035- left .asCfgNode ( ) = slash .getLeft ( ) and
1036- left .getALocalSource ( ) = pathlibPath ( )
1037- |
1038- nodeTo .asCfgNode ( ) = slash and
10391039 (
1040- // type-preserving call
1041- nodeFrom = left
1040+ path_operand . asCfgNode ( ) = slash . getLeft ( ) and
1041+ data_operand . asCfgNode ( ) = slash . getRight ( )
10421042 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+ ]
10461055 )
10471056 or
10481057 // standard case
0 commit comments