Skip to content

Commit 8f2013c

Browse files
committed
Simplify StartsWithCheck
1 parent bf8c7a2 commit 8f2013c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

python/ql/src/experimental/semmle/python/security/injection/CsvInjection.qll

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ class CsvInjectionFlowConfig extends TaintTracking::Configuration {
2121
}
2222
}
2323

24-
class StartsWithCheck extends DataFlow::BarrierGuard {
25-
StartsWithCheck() { this.(CallNode).getNode().getFunc().(Attribute).getName() = "startswith" }
24+
private class StartsWithCheck extends DataFlow::BarrierGuard {
25+
Attribute attr;
26+
27+
StartsWithCheck() {
28+
this.(CallNode).getNode().getFunc() = attr and
29+
attr.getName() = "startswith"
30+
}
2631

2732
override predicate checks(ControlFlowNode node, boolean branch) {
28-
node = this.(CallNode).getNode().getFunc().(Attribute).getObject().getAFlowNode() and
33+
node = attr.getObject().getAFlowNode() and
2934
branch = true
3035
}
3136
}

0 commit comments

Comments
 (0)