Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0eb8b6c

Browse files
committed
Python: Address review
1 parent 5dbb4af commit 0eb8b6c

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

python/ql/src/experimental/dataflow/internal/DataFlowPublic.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,10 @@ class BarrierGuard extends GuardNode {
176176

177177
/** Gets a node guarded by this guard. */
178178
final ExprNode getAGuardedNode() {
179-
exists(boolean testIsTrue |
180-
this.checks(result.asCfgNode(), testIsTrue) and
179+
exists(Variable v, NameNode n, boolean testIsTrue |
180+
n.uses(v) and
181+
this.checks(n, testIsTrue) and
182+
result.asCfgNode().(NameNode).uses(v) and
181183
this.controlsNode(result.asCfgNode(), testIsTrue)
182184
)
183185
}

python/ql/test/experimental/dataflow/tainttracking/customSanitizer/TestTaint.ql

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import experimental.dataflow.tainttracking.TestTaintLib
22

33
class IsSafeCheck extends DataFlow::BarrierGuard {
4-
Variable v;
5-
6-
IsSafeCheck() {
7-
this.(CallNode).getNode().getFunc().(Name).getId() = "emulated_is_safe" and
8-
this.(CallNode).getAnArg().(NameNode).uses(v)
9-
}
4+
IsSafeCheck() { this.(CallNode).getNode().getFunc().(Name).getId() = "emulated_is_safe" }
105

116
override predicate checks(ControlFlowNode node, boolean testIsTrue) {
12-
node.(NameNode).uses(v) and
7+
node = this.(CallNode).getAnArg() and
138
testIsTrue = true
149
}
1510
}

0 commit comments

Comments
 (0)