Skip to content

Commit 7a0fc6a

Browse files
author
Benjamin Muskalla
committed
Migrate jaxson to inline test
1 parent 4189195 commit 7a0fc6a

File tree

1 file changed

+2
-32
lines changed
  • java/ql/test/library-tests/dataflow/taint-jackson

1 file changed

+2
-32
lines changed
Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,4 @@
11
import java
2-
import semmle.code.java.dataflow.DataFlow
3-
import semmle.code.java.dataflow.TaintTracking
4-
import semmle.code.java.dataflow.FlowSources
5-
import TestUtilities.InlineExpectationsTest
2+
import TestUtilities.InlineFlowTest
63

7-
class Conf extends TaintTracking::Configuration {
8-
Conf() { this = "qltest:dataflow:jackson" }
9-
10-
override predicate isSource(DataFlow::Node n) {
11-
n.asExpr().(MethodAccess).getMethod().hasName("taint")
12-
or
13-
n instanceof RemoteFlowSource
14-
}
15-
16-
override predicate isSink(DataFlow::Node n) {
17-
exists(MethodAccess ma | ma.getMethod().hasName("sink") | n.asExpr() = ma.getAnArgument())
18-
}
19-
}
20-
21-
class HasFlowTest extends InlineExpectationsTest {
22-
HasFlowTest() { this = "HasFlowTest" }
23-
24-
override string getARelevantTag() { result = "hasTaintFlow" }
25-
26-
override predicate hasActualResult(Location location, string element, string tag, string value) {
27-
tag = "hasTaintFlow" and
28-
exists(DataFlow::Node src, DataFlow::Node sink, Conf conf | conf.hasFlow(src, sink) |
29-
sink.getLocation() = location and
30-
element = sink.toString() and
31-
value = ""
32-
)
33-
}
34-
}
4+
class HasFlowTest extends InlineFlowTest { }

0 commit comments

Comments
 (0)