TaintAnalysis
TaintAnalysis copied to clipboard
The variable 't' is not recognized as a taint.
I constructed a testcase named 'Field6' and then executed the following test code, only to discover that the variable 't' was not identified as a tainted variable.
@Test
public void Field6() {
JimpleIFDSSolver<?, ? extends InterproceduralCFG<Unit, SootMethod>> analysis = executeStaticAnalysis(target.taint.Filed6.class.getName());
Set<String> defaultIDEResult = getResult(analysis);
Set<String> expected = new HashSet<>();
expected.add("a");
expected.add("f.x");
expected.add("t");
checkResults(defaultIDEResult, expected);
}
package target.taint;
import target.taint.internal.SourceClass;
public class Filed6 {
private String x;
private String y;
public static void main(String[] args) {
Filed6 f = new Filed6();
SourceClass sc = new SourceClass();
String a = sc.anInstanceSource();
f.setX(a);
String t = f.getOther();
}
public void setX(String x) {
this.x = x;
}
public String getX() {
return x;
}
public void setY(String y) {
this.y = y;
}
public String getY() {
return y;
}
public String getOther(){
return this.x;
}
}