mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#/Java: Add some examples of missing synthetic field element flow.
This commit is contained in:
@@ -839,6 +839,23 @@ public class SyntheticProperties
|
||||
}
|
||||
}
|
||||
|
||||
public class SyntheticCollections
|
||||
{
|
||||
private object[] array;
|
||||
|
||||
// summary=Models;SyntheticCollections;false;SyntheticCollections;(System.Object[]);;Argument[0].Element;Argument[this];taint;df-generated
|
||||
public SyntheticCollections(object[] array)
|
||||
{
|
||||
this.array = array;
|
||||
}
|
||||
|
||||
// summary=Models;SyntheticCollections;false;GetElement;(System.Int32);;Argument[this];ReturnValue;taint;df-generated
|
||||
public object GetElement(int index)
|
||||
{
|
||||
return array[index];
|
||||
}
|
||||
}
|
||||
|
||||
public class Fanout
|
||||
{
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package p;
|
||||
|
||||
public class SyntheticCollections {
|
||||
private String[] array;
|
||||
|
||||
// summary=p;SyntheticCollections;true;SyntheticCollections;(String[]);;Argument[0].ArrayElement;Argument[this];taint;df-generated
|
||||
public SyntheticCollections(String[] array) {
|
||||
this.array = array;
|
||||
}
|
||||
|
||||
// summary=p;SyntheticCollections;true;getElement;(Integer);;Argument[this];ReturnValue;taint;df-generated
|
||||
public String getElement(Integer index) {
|
||||
return array[index];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user