Skip to content

Commit 5469a82

Browse files
committed
Go,Java,Python: Fix some tests.
1 parent 64c60d5 commit 5469a82

File tree

4 files changed

+19
-28
lines changed

4 files changed

+19
-28
lines changed

go/ql/test/library-tests/semmle/go/dataflow/VarArgsWithFunctionModels/Flows.ql

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class DataConfiguration extends DataFlow::Configuration {
4141
override predicate isSink(DataFlow::Node sink) {
4242
sink = any(DataFlow::CallNode c | c.getCalleeName() = "sink").getArgument(0)
4343
}
44-
45-
override int explorationLimit() { result = 10 } // this is different!
4644
}
4745

4846
class DataFlowTest extends InlineExpectationsTest {
@@ -71,8 +69,6 @@ class TaintConfiguration extends TaintTracking::Configuration {
7169
override predicate isSink(DataFlow::Node sink) {
7270
sink = any(DataFlow::CallNode c | c.getCalleeName() = "sink").getArgument(0)
7371
}
74-
75-
override int explorationLimit() { result = 10 } // this is different!
7672
}
7773

7874
class TaintFlowTest extends InlineExpectationsTest {

go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@ edges
66
| tst.go:10:13:10:35 | call to FormValue | tst.go:24:66:24:72 | tainted |
77
| tst.go:10:13:10:35 | call to FormValue | tst.go:27:11:27:29 | ...+... |
88
| tst.go:10:13:10:35 | call to FormValue | tst.go:29:11:29:40 | ...+... |
9-
| tst.go:10:13:10:35 | call to FormValue | tst.go:36:2:36:2 | implicit dereference |
109
| tst.go:10:13:10:35 | call to FormValue | tst.go:37:11:37:20 | call to String |
11-
| tst.go:35:2:35:2 | definition of u [pointer] | tst.go:36:2:36:2 | u [pointer] |
12-
| tst.go:36:2:36:2 | implicit dereference | tst.go:35:2:35:2 | definition of u [pointer] |
13-
| tst.go:36:2:36:2 | implicit dereference | tst.go:36:2:36:2 | implicit dereference |
14-
| tst.go:36:2:36:2 | implicit dereference | tst.go:37:11:37:20 | call to String |
15-
| tst.go:36:2:36:2 | u [pointer] | tst.go:36:2:36:2 | implicit dereference |
1610
| websocket.go:60:21:60:31 | call to Referer | websocket.go:65:27:65:40 | untrustedInput |
1711
| websocket.go:74:21:74:31 | call to Referer | websocket.go:78:36:78:49 | untrustedInput |
1812
| websocket.go:88:21:88:31 | call to Referer | websocket.go:91:31:91:44 | untrustedInput |
@@ -32,9 +26,6 @@ nodes
3226
| tst.go:24:66:24:72 | tainted | semmle.label | tainted |
3327
| tst.go:27:11:27:29 | ...+... | semmle.label | ...+... |
3428
| tst.go:29:11:29:40 | ...+... | semmle.label | ...+... |
35-
| tst.go:35:2:35:2 | definition of u [pointer] | semmle.label | definition of u [pointer] |
36-
| tst.go:36:2:36:2 | implicit dereference | semmle.label | implicit dereference |
37-
| tst.go:36:2:36:2 | u [pointer] | semmle.label | u [pointer] |
3829
| tst.go:37:11:37:20 | call to String | semmle.label | call to String |
3930
| websocket.go:60:21:60:31 | call to Referer | semmle.label | call to Referer |
4031
| websocket.go:65:27:65:40 | untrustedInput | semmle.label | untrustedInput |

java/ql/test/library-tests/dataflow/state/test.ql

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,48 +39,52 @@ predicate step(Node n1, Node n2, string s1, string s2) {
3939

4040
predicate checkNode(Node n) { n.asExpr().(Argument).getCall().getCallee().hasName("check") }
4141

42-
class Conf extends TaintTracking::Configuration {
43-
Conf() { this = "qltest:state" }
42+
module Conf implements DataFlow::StateConfigSig {
43+
class FlowState = string;
4444

45-
override predicate isSource(Node n, FlowState s) { src(n, s) }
45+
predicate isSource(Node n, FlowState s) { src(n, s) }
4646

47-
override predicate isSink(Node n, FlowState s) { sink(n, s) }
47+
predicate isSink(Node n, FlowState s) { sink(n, s) }
4848

49-
override predicate isSanitizer(Node n, FlowState s) { bar(n, s) }
49+
predicate isBarrier(Node n, FlowState s) { bar(n, s) }
5050

51-
override predicate isAdditionalTaintStep(Node n1, FlowState s1, Node n2, FlowState s2) {
51+
predicate isAdditionalFlowStep(Node n1, FlowState s1, Node n2, FlowState s2) {
5252
step(n1, n2, s1, s2)
5353
}
54-
55-
override int explorationLimit() { result = 0 }
5654
}
5755

56+
int explorationLimit() { result = 0 }
57+
58+
module Flow = TaintTracking::MakeWithState<Conf>;
59+
60+
module PartialFlow = Flow::FlowExploration<explorationLimit/0>;
61+
5862
class HasFlowTest extends InlineExpectationsTest {
5963
HasFlowTest() { this = "HasFlowTest" }
6064

6165
override string getARelevantTag() { result = ["pFwd", "pRev", "flow"] }
6266

6367
override predicate hasActualResult(Location location, string element, string tag, string value) {
6468
tag = "flow" and
65-
exists(PathNode src, PathNode sink, Conf conf |
66-
conf.hasFlowPath(src, sink) and
69+
exists(Flow::PathNode src, Flow::PathNode sink |
70+
Flow::hasFlowPath(src, sink) and
6771
sink.getNode().getLocation() = location and
6872
element = sink.toString() and
6973
value = src.getState()
7074
)
7175
or
7276
tag = "pFwd" and
73-
exists(PartialPathNode src, PartialPathNode node, Conf conf |
74-
conf.hasPartialFlow(src, node, _) and
77+
exists(PartialFlow::PartialPathNode src, PartialFlow::PartialPathNode node |
78+
PartialFlow::hasPartialFlow(src, node, _) and
7579
checkNode(node.getNode()) and
7680
node.getNode().getLocation() = location and
7781
element = node.toString() and
7882
value = src.getState() + "-" + node.getState()
7983
)
8084
or
8185
tag = "pRev" and
82-
exists(PartialPathNode node, PartialPathNode sink, Conf conf |
83-
conf.hasPartialFlowRev(node, sink, _) and
86+
exists(PartialFlow::PartialPathNode node, PartialFlow::PartialPathNode sink |
87+
PartialFlow::hasPartialFlowRev(node, sink, _) and
8488
checkNode(node.getNode()) and
8589
node.getNode().getLocation() = location and
8690
element = node.toString() and

python/ql/test/experimental/meta/debug/InlineTaintTestPaths.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import experimental.meta.InlineTaintTest::Conf
1414
import DataFlow::PathGraph
1515

1616
class Conf extends TestTaintTrackingConfiguration {
17-
override int explorationLimit() { result = 5 }
17+
// override int explorationLimit() { result = 5 }
1818
}
1919

2020
// from Conf config, DataFlow::PartialPathNode source, DataFlow::PartialPathNode sink

0 commit comments

Comments
 (0)