Skip to content

Commit f0bfd70

Browse files
committed
Java: Add test case.
1 parent 11665be commit f0bfd70

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

java/ql/test/library-tests/dataflow/entrypoint-types/EntryPointTypesTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ class UnrelatedObject {
4141
public String safeField;
4242
}
4343

44+
static class ArrayElemObject {
45+
public String field;
46+
}
47+
4448
private static void sink(String sink) {}
4549

4650
public static void test(TestObject source) {
@@ -70,4 +74,8 @@ public static void testSubtype(ParameterizedTestObject<?, ?> source) {
7074
UnrelatedObject unrelated = (UnrelatedObject) subtypeSource.getField8();
7175
sink(unrelated.safeField); // Safe
7276
}
77+
78+
public static void testArray(ArrayElemObject[] source) {
79+
sink(source[0].field); // $hasTaintFlow
80+
}
7381
}

0 commit comments

Comments
 (0)