mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Java: Add test case.
This commit is contained in:
@@ -41,6 +41,10 @@ public class EntryPointTypesTest {
|
||||
public String safeField;
|
||||
}
|
||||
|
||||
static class ArrayElemObject {
|
||||
public String field;
|
||||
}
|
||||
|
||||
private static void sink(String sink) {}
|
||||
|
||||
public static void test(TestObject source) {
|
||||
@@ -70,4 +74,8 @@ public class EntryPointTypesTest {
|
||||
UnrelatedObject unrelated = (UnrelatedObject) subtypeSource.getField8();
|
||||
sink(unrelated.safeField); // Safe
|
||||
}
|
||||
|
||||
public static void testArray(ArrayElemObject[] source) {
|
||||
sink(source[0].field); // $hasTaintFlow
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user