Skip to content

Commit 050e720

Browse files
RasmusWLyoff
andauthored
Python: Minor rewrite
Co-authored-by: yoff <lerchedahl@gmail.com>
1 parent 272feed commit 050e720

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

python/ql/src/semmle/python/frameworks/Stdlib.qll

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,15 +1258,12 @@ private module Stdlib {
12581258
private class AdditionalTaintStep extends TaintTracking::AdditionalTaintStep {
12591259
override predicate step(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
12601260
// Methods
1261-
exists(DataFlow::AttrRead read | read = nodeTo and read.getObject() = nodeFrom |
1262-
nodeFrom = instance() and
1263-
nodeTo in [getvalueRef(), getfirstRef(), getlistRef()]
1264-
)
1261+
nodeFrom = nodeTo.(DataFlow::AttrRead).getObject() and
1262+
nodeFrom = instance() and
1263+
nodeTo in [getvalueRef(), getfirstRef(), getlistRef()]
12651264
or
1266-
exists(CallNode call |
1267-
nodeTo.asCfgNode() = call and
1268-
call.getFunction() = nodeFrom.asCfgNode()
1269-
|
1265+
nodeFrom.asCfgNode() = nodeTo.asCfgNode().(CallNode).getFunction() and
1266+
(
12701267
nodeFrom = getvalueRef() and nodeTo = getvalueResult()
12711268
or
12721269
nodeFrom = getfirstRef() and nodeTo = getfirstResult()

0 commit comments

Comments
 (0)