|
2 | 2 |
|
3 | 3 | import csharp |
4 | 4 | private import system.Reflection |
| 5 | +private import semmle.code.csharp.dataflow.ExternalFlow |
5 | 6 |
|
6 | 7 | /** The `System` namespace. */ |
7 | 8 | class SystemNamespace extends Namespace { |
@@ -200,6 +201,28 @@ class SystemInt32Struct extends IntType { |
200 | 201 | } |
201 | 202 | } |
202 | 203 |
|
| 204 | +/** Data flow for `System.Int32`. */ |
| 205 | +private class SystemInt32FlowModelCsv extends SummaryModelCsv { |
| 206 | + override predicate row(string row) { |
| 207 | + row = |
| 208 | + [ |
| 209 | + "System;Int32;false;Parse;(System.String);;Argument[0];ReturnValue;taint", |
| 210 | + "System;Int32;false;Parse;(System.String,System.IFormatProvider);;Argument[0];ReturnValue;taint", |
| 211 | + "System;Int32;false;Parse;(System.String,System.Globalization.NumberStyles);;Argument[0];ReturnValue;taint", |
| 212 | + "System;Int32;false;Parse;(System.String,System.Globalization.NumberStyles,System.IFormatProvider);;Argument[0];ReturnValue;taint", |
| 213 | + "System;Int32;false;Parse;(System.ReadOnlySpan<System.Char>,System.Globalization.NumberStyles,System.IFormatProvider);;Element of Argument[0];ReturnValue;taint", |
| 214 | + "System;Int32;false;TryParse;(System.String,System.Int32);;Argument[0];ReturnValue;taint", |
| 215 | + "System;Int32;false;TryParse;(System.String,System.Int32);;Argument[0];Argument[1];taint", |
| 216 | + "System;Int32;false;TryParse;(System.ReadOnlySpan<System.Char>,System.Int32);;Element of Argument[0];ReturnValue;taint", |
| 217 | + "System;Int32;false;TryParse;(System.ReadOnlySpan<System.Char>,System.Int32);;Element of Argument[0];Argument[1];taint", |
| 218 | + "System;Int32;false;TryParse;(System.String,System.Globalization.NumberStyles,System.IFormatProvider,System.Int32);;Argument[0];ReturnValue;taint", |
| 219 | + "System;Int32;false;TryParse;(System.String,System.Globalization.NumberStyles,System.IFormatProvider,System.Int32);;Argument[0];Argument[3];taint", |
| 220 | + "System;Int32;false;TryParse;(System.ReadOnlySpan<System.Char>,System.Globalization.NumberStyles,System.IFormatProvider,System.Int32);;Element of Argument[0];ReturnValue;taint", |
| 221 | + "System;Int32;false;TryParse;(System.ReadOnlySpan<System.Char>,System.Globalization.NumberStyles,System.IFormatProvider,System.Int32);;Element of Argument[0];Argument[3];taint" |
| 222 | + ] |
| 223 | + } |
| 224 | +} |
| 225 | + |
203 | 226 | /** The `System.InvalidCastException` class. */ |
204 | 227 | class SystemInvalidCastExceptionClass extends SystemClass { |
205 | 228 | SystemInvalidCastExceptionClass() { this.hasName("InvalidCastException") } |
|
0 commit comments