Files
codeql/java/ql/test/library-tests/dataflow/taintsources/IntentSources.java
2021-02-09 09:16:57 -05:00

38 lines
749 B
Java

package com.example.myapp;
import android.app.Activity;
public class IntentSources extends Activity {
public void test() throws java.io.IOException {
String trouble = this.getIntent().getStringExtra("key");
Runtime.getRuntime().exec(trouble);
}
public void test2() throws java.io.IOException {
String trouble = getIntent().getStringExtra("key");
Runtime.getRuntime().exec(trouble);
}
public void test3() throws java.io.IOException {
String trouble = getIntent().getExtras().getString("key");
Runtime.getRuntime().exec(trouble);
}
}
class OtherClass {
public void test(IntentSources is) throws java.io.IOException {
String trouble = is.getIntent().getStringExtra("key");
Runtime.getRuntime().exec(trouble);
}
}