Skip to content

Commit a555e04

Browse files
committed
C#: Bulk array flow.
1 parent 226a874 commit a555e04

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

csharp/ql/test/utils/model-generator/CaptureSummaryModels.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
| Summaries;BasicFlow;false;ReturnSubstring;(System.String);Argument[0];ReturnValue;taint |
77
| Summaries;BasicFlow;false;ReturnThis;(System.Object);Argument[Qualifier];ReturnValue;value |
88
| Summaries;BasicFlow;false;SetField;(System.String);Argument[0];Argument[Qualifier];taint |
9+
| Summaries;BulkArrayFlow;false;AssignFieldToBulkArray;(System.Char[]);Argument[Qualifier];Argument[0];taint |
10+
| Summaries;BulkArrayFlow;false;AssignToBulkArray;(System.Char[],System.Char);Argument[1];Argument[0];taint |
11+
| Summaries;BulkArrayFlow;false;ReturnBulkArrayElement;(System.Byte[]);Argument[0];ReturnValue;taint |
912
| Summaries;CollectionFlow;false;AddFieldToList;(System.Collections.Generic.List<System.String>);Argument[Qualifier];Argument[0].Element;taint |
1013
| Summaries;CollectionFlow;false;AddToList;(System.Collections.Generic.List<System.Object>,System.Object);Argument[1];Argument[0].Element;taint |
1114
| Summaries;CollectionFlow;false;AssignFieldToArray;(System.Object[]);Argument[Qualifier];Argument[0].Element;taint |

csharp/ql/test/utils/model-generator/Summaries.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,24 @@ public IEnumerable<string> ReturnFieldInIEnumerable()
102102
{
103103
return new List<string> { tainted };
104104
}
105+
}
106+
107+
public class BulkArrayFlow
108+
{
109+
private char tainted;
110+
111+
public void AssignToBulkArray(char[] input, char data)
112+
{
113+
input[0] = data;
114+
}
115+
116+
public byte ReturnBulkArrayElement(byte[] input)
117+
{
118+
return input[0];
119+
}
120+
121+
public void AssignFieldToBulkArray(char[] input)
122+
{
123+
input[0] = tainted;
124+
}
105125
}

0 commit comments

Comments
 (0)