Skip to content

Commit babf1d6

Browse files
committed
Kotlin: Track Kotlin's Array.set when tracking taint
1 parent 124487c commit babf1d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,14 @@ predicate arrayStoreStep(Node node1, Node node2) {
450450
exists(Assignment assign | assign.getSource() = node1.asExpr() |
451451
node2.(PostUpdateNode).getPreUpdateNode().asExpr() = assign.getDest().(ArrayAccess).getArray()
452452
)
453+
or
454+
exists(Expr arr, Call call |
455+
arr = node2.asExpr() and
456+
call.getArgument(1) = node1.asExpr() and
457+
call.getQualifier() = arr and
458+
arr.getType() instanceof ArrayType and
459+
call.getCallee().getName() = "set"
460+
)
453461
}
454462

455463
private predicate enhancedForStmtStep(Node node1, Node node2, Type containerType) {

0 commit comments

Comments
 (0)