MCPcopy Create free account
hub / github.com/LFYSec/MScan / StaticTaintTransfer

Class StaticTaintTransfer

src/test/resources/pta/taint/StaticTaintTransfer.java:1–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class StaticTaintTransfer {
2
3 public static void main(String[] args) {
4 String arr[] = new String[1];
5 arr[0] = SourceSink.source();
6 String result[] = mapString(arr, new Mapper() {
7 @Override
8 public String map(String s) {
9 return concat("hello, ", s);
10 }
11 });
12 SourceSink.sink(result[0]);
13 }
14
15 static String concat(String lhs, String rhs) {
16 return new String();
17 }
18
19 static String[] mapString(String arr[], Mapper mapper) {
20 String result[] = new String[arr.length];
21 for (int i = 0; i < arr.length; ++i) {
22 result[i] = mapper.map(arr[i]);
23 }
24 return result;
25 }
26}
27
28interface Mapper {
29 public String map(String s);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected