Skip to content

Commit b9a98f5

Browse files
committed
update existing tests to work with FunctionReturnNode
1 parent 0edb46c commit b9a98f5

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

javascript/ql/test/library-tests/InterProceduralFlow/DataFlowConfig.qll

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ class TestDataFlowConfiguration extends DataFlow::Configuration {
1717
)
1818
}
1919

20-
override predicate isBarrierEdge(DataFlow::Node src, DataFlow::Node snk) {
21-
src = src and
22-
snk.asExpr().(PropAccess).getPropertyName() = "notTracked"
23-
or
20+
override predicate isBarrier(DataFlow::Node node) {
2421
exists(Function f |
2522
f.getName().matches("%noReturnTracking%") and
26-
src = f.getAReturnedExpr().flow() and
27-
snk.(DataFlow::InvokeNode).getACallee() = f
23+
node = f.getAReturnedExpr().flow()
2824
)
2925
}
26+
27+
override predicate isBarrierEdge(DataFlow::Node src, DataFlow::Node snk) {
28+
src = src and
29+
snk.asExpr().(PropAccess).getPropertyName() = "notTracked"
30+
}
3031
}

javascript/ql/test/library-tests/InterProceduralFlow/GermanFlow.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
| tst2.js:3:17:3:26 | "tainted2" | tst2.js:11:15:11:24 | g(source2) |
5454
| tst2.js:6:24:6:37 | "also tainted" | tst2.js:10:15:10:24 | g(source1) |
5555
| tst2.js:6:24:6:37 | "also tainted" | tst2.js:11:15:11:24 | g(source2) |
56-
| tst3.js:2:17:2:26 | "tainted1" | tst3.js:6:15:6:40 | noRetur ... ource1) |
57-
| tst3.js:9:19:9:28 | "tainted2" | tst3.js:12:15:12:33 | noReturnTracking2() |
5856
| tst6.mjs:12:14:12:21 | "source" | tst6.mjs:14:12:14:16 | a.m() |
5957
| tst6.mjs:16:15:16:23 | "source2" | tst6.mjs:18:13:18:24 | a.m.call(a2) |
6058
| tst.js:2:17:2:22 | "src1" | tst.js:28:20:28:22 | elt |

javascript/ql/test/library-tests/InterProceduralFlow/TaintTracking.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
| tst2.js:3:17:3:26 | "tainted2" | tst2.js:11:15:11:24 | g(source2) |
5959
| tst2.js:6:24:6:37 | "also tainted" | tst2.js:10:15:10:24 | g(source1) |
6060
| tst2.js:6:24:6:37 | "also tainted" | tst2.js:11:15:11:24 | g(source2) |
61-
| tst3.js:2:17:2:26 | "tainted1" | tst3.js:6:15:6:40 | noRetur ... ource1) |
62-
| tst3.js:9:19:9:28 | "tainted2" | tst3.js:12:15:12:33 | noReturnTracking2() |
6361
| tst4.js:2:16:2:24 | "tainted" | tst4.js:15:15:15:31 | id(still_tainted) |
6462
| tst4.js:2:16:2:24 | "tainted" | tst4.js:16:15:16:28 | p.also_tainted |
6563
| tst4.js:2:16:2:24 | "tainted" | tst4.js:17:15:17:28 | substr(source) |

javascript/ql/test/library-tests/InterProceduralFlow/TaintTracking.ql

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ class TestTaintTrackingConfiguration extends TaintTracking::Configuration {
1717
)
1818
}
1919

20-
override predicate isSanitizerEdge(DataFlow::Node src, DataFlow::Node snk) {
21-
src = src and
22-
snk.asExpr().(PropAccess).getPropertyName() = "notTracked"
23-
or
20+
override predicate isSanitizer(DataFlow::Node node) {
2421
exists(Function f |
2522
f.getName().matches("%noReturnTracking%") and
26-
src = f.getAReturnedExpr().flow() and
27-
snk.(DataFlow::InvokeNode).getACallee() = f
23+
node = f.getAReturnedExpr().flow()
2824
)
2925
}
26+
27+
override predicate isSanitizerEdge(DataFlow::Node src, DataFlow::Node snk) {
28+
src = src and
29+
snk.asExpr().(PropAccess).getPropertyName() = "notTracked"
30+
}
3031
}
3132

3233
from TestTaintTrackingConfiguration tttc, DataFlow::Node src, DataFlow::Node snk

0 commit comments

Comments
 (0)