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

Skip to content

Commit 3aedadc

Browse files
committed
Java: Add localExprFlow and localExprTaint.
1 parent 1b63395 commit 3aedadc

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

java/ql/src/semmle/code/java/dataflow/internal/DataFlowUtil.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,12 @@ private module ThisFlow {
334334
*/
335335
predicate localFlow(Node node1, Node node2) { localFlowStep*(node1, node2) }
336336

337+
/**
338+
* Holds if data can flow from `e1` to `e2` in zero or more
339+
* local (intra-procedural) steps.
340+
*/
341+
predicate localExprFlow(Expr e1, Expr e2) { localFlow(exprNode(e1), exprNode(e2)) }
342+
337343
/**
338344
* Holds if the `FieldRead` is not completely determined by explicit SSA
339345
* updates.

java/ql/src/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ private import semmle.code.java.dataflow.internal.ContainerFlow
1717
*/
1818
predicate localTaint(DataFlow::Node src, DataFlow::Node sink) { localTaintStep*(src, sink) }
1919

20+
/**
21+
* Holds if taint can flow from `src` to `sink` in zero or more
22+
* local (intra-procedural) steps.
23+
*/
24+
predicate localExprTaint(Expr src, Expr sink) {
25+
localTaint(DataFlow::exprNode(src), DataFlow::exprNode(sink))
26+
}
27+
2028
/**
2129
* Holds if taint can flow in one local step from `src` to `sink`.
2230
*/

0 commit comments

Comments
 (0)