Skip to content

Commit 3b41c2f

Browse files
committed
Python: Use new MethodCallNode in TaintTrackingPrivate
1 parent 0b767bb commit 3b41c2f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

python/ql/src/semmle/python/dataflow/new/internal/TaintTrackingPrivate.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,20 +165,20 @@ predicate containerStep(DataFlow::CfgNode nodeFrom, DataFlow::Node nodeTo) {
165165
)
166166
or
167167
// methods
168-
exists(DataFlow::CallCfgNode call, string name | call = nodeTo |
169-
name in [
168+
exists(DataFlow::MethodCallNode call, string methodName | call = nodeTo |
169+
methodName in [
170170
// general
171171
"copy", "pop",
172172
// dict
173173
"values", "items", "get", "popitem"
174174
] and
175-
call.getFunction().(DataFlow::AttrRead).getObject(name) = nodeFrom
175+
call.calls(nodeFrom, methodName)
176176
)
177177
or
178178
// list.append, set.add
179-
exists(DataFlow::CallCfgNode call, string name |
180-
name in ["append", "add"] and
181-
call.getFunction().(DataFlow::AttrRead).getObject(name).getPostUpdateNode() = nodeTo and
179+
exists(DataFlow::MethodCallNode call, DataFlow::Node obj |
180+
call.calls(obj, ["append", "add"]) and
181+
obj.getPostUpdateNode() = nodeTo and
182182
call.getArg(0) = nodeFrom
183183
)
184184
}

0 commit comments

Comments
 (0)