File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed
csharp/ql/test/utils/model-generator Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change 17
17
| Summaries;CollectionFlow;false;ReturnArrayElement;(System.Int32[]);Argument[0].Element;ReturnValue;taint |
18
18
| Summaries;CollectionFlow;false;ReturnFieldInAList;();Argument[Qualifier];ReturnValue;taint |
19
19
| Summaries;CollectionFlow;false;ReturnListElement;(System.Collections.Generic.List<System.Object>);Argument[0].Element;ReturnValue;taint |
20
+ | Summaries;GenericFlow<>;false;AddFieldToGenericList;(System.Collections.Generic.List<T>);Argument[Qualifier];Argument[0].Element;taint |
21
+ | Summaries;GenericFlow<>;false;AddToGenericList<>;(System.Collections.Generic.List<S>,S);Argument[1];Argument[0].Element;taint |
22
+ | Summaries;GenericFlow<>;false;ReturnFieldInGenericList;();Argument[Qualifier];ReturnValue;taint |
23
+ | Summaries;GenericFlow<>;false;ReturnGenericElement<>;(System.Collections.Generic.List<S>);Argument[0].Element;ReturnValue;taint |
24
+ | Summaries;GenericFlow<>;false;ReturnGenericField;();Argument[Qualifier];ReturnValue;taint |
25
+ | Summaries;GenericFlow<>;false;ReturnGenericParam<>;(S);Argument[0];ReturnValue;taint |
26
+ | Summaries;GenericFlow<>;false;SetGenericField;(T);Argument[0];Argument[Qualifier];taint |
20
27
| Summaries;IEnumerableFlow;false;ReturnFieldInIEnumerable;();Argument[Qualifier];ReturnValue;taint |
21
28
| Summaries;IEnumerableFlow;false;ReturnIEnumerable;(System.Collections.Generic.IEnumerable<System.String>);Argument[0].Element;ReturnValue;taint |
22
29
| Summaries;IEnumerableFlow;false;ReturnIEnumerableElement;(System.Collections.Generic.IEnumerable<System.Object>);Argument[0].Element;ReturnValue;taint |
Original file line number Diff line number Diff line change @@ -122,4 +122,44 @@ public void AssignFieldToBulkArray(char[] input)
122
122
{
123
123
input [ 0 ] = tainted ;
124
124
}
125
- }
125
+ }
126
+
127
+ public class GenericFlow < T >
128
+ {
129
+ private T tainted ;
130
+
131
+ public void SetGenericField ( T t )
132
+ {
133
+ tainted = t ;
134
+ }
135
+
136
+ public T ReturnGenericField ( )
137
+ {
138
+ return tainted ;
139
+ }
140
+
141
+ public void AddFieldToGenericList ( List < T > input )
142
+ {
143
+ input . Add ( tainted ) ;
144
+ }
145
+
146
+ public List < T > ReturnFieldInGenericList ( )
147
+ {
148
+ return new List < T > { tainted } ;
149
+ }
150
+
151
+ public S ReturnGenericParam < S > ( S input )
152
+ {
153
+ return input ;
154
+ }
155
+
156
+ public S ReturnGenericElement < S > ( List < S > input )
157
+ {
158
+ return input [ 0 ] ;
159
+ }
160
+
161
+ public void AddToGenericList < S > ( List < S > input , S data )
162
+ {
163
+ input . Add ( data ) ;
164
+ }
165
+ }
You can’t perform that action at this time.
0 commit comments