|
2 | 2 |
|
3 | 3 | import csharp
|
4 | 4 | private import semmle.code.csharp.frameworks.System
|
| 5 | +private import semmle.code.csharp.dataflow.ExternalFlow |
5 | 6 |
|
6 | 7 | /** The `System.IO` namespace. */
|
7 | 8 | class SystemIONamespace extends Namespace {
|
@@ -41,11 +42,40 @@ class SystemIOPathClass extends SystemIOClass {
|
41 | 42 | SystemIOPathClass() { this.hasName("Path") }
|
42 | 43 | }
|
43 | 44 |
|
| 45 | +/** Data flow for `System.IO.TextReader`. */ |
| 46 | +private class SystemIOTextReaderFlowModelCsv extends SummaryModelCsv { |
| 47 | + override predicate row(string row) { |
| 48 | + row = |
| 49 | + [ |
| 50 | + "System.IO;TextReader;true;Read;();;Argument[-1];ReturnValue;taint", |
| 51 | + "System.IO;TextReader;true;Read;(System.Char[],System.Int32,System.Int32);;Argument[-1];ReturnValue;taint", |
| 52 | + "System.IO;TextReader;true;Read;(System.Span<System.Char>);;Argument[-1];ReturnValue;taint", |
| 53 | + "System.IO;TextReader;true;ReadAsync;(System.Char[],System.Int32,System.Int32);;Argument[-1];ReturnValue;taint", |
| 54 | + "System.IO;TextReader;true;ReadAsync;(System.Memory<System.Char>,System.Threading.CancellationToken);;Argument[-1];ReturnValue;taint", |
| 55 | + "System.IO;TextReader;true;ReadBlock;(System.Char[],System.Int32,System.Int32);;Argument[-1];ReturnValue;taint", |
| 56 | + "System.IO;TextReader;true;ReadBlock;(System.Span<System.Char>);;Argument[-1];ReturnValue;taint", |
| 57 | + "System.IO;TextReader;true;ReadBlockAsync;(System.Char[],System.Int32,System.Int32);;Argument[-1];ReturnValue;taint", |
| 58 | + "System.IO;TextReader;true;ReadBlockAsync;(System.Memory<System.Char>,System.Threading.CancellationToken);;Argument[-1];ReturnValue;taint", |
| 59 | + "System.IO;TextReader;true;ReadLine;();;Argument[-1];ReturnValue;taint", |
| 60 | + "System.IO;TextReader;true;ReadLineAsync;();;Argument[-1];ReturnValue;taint", |
| 61 | + "System.IO;TextReader;true;ReadToEnd;();;Argument[-1];ReturnValue;taint", |
| 62 | + "System.IO;TextReader;true;ReadToEndAsync;();;Argument[-1];ReturnValue;taint", |
| 63 | + ] |
| 64 | + } |
| 65 | +} |
| 66 | + |
44 | 67 | /** The `System.IO.StringReader` class. */
|
45 | 68 | class SystemIOStringReaderClass extends SystemIOClass {
|
46 | 69 | SystemIOStringReaderClass() { this.hasName("StringReader") }
|
47 | 70 | }
|
48 | 71 |
|
| 72 | +/** Data flow for `System.IO.StringReader` */ |
| 73 | +private class SystemIOStringReaderFlowModelCsv extends SummaryModelCsv { |
| 74 | + override predicate row(string row) { |
| 75 | + row = "System.IO;StringReader;false;StringReader;(System.String);;Argument[0];ReturnValue;taint" |
| 76 | + } |
| 77 | +} |
| 78 | + |
49 | 79 | /** The `System.IO.Stream` class. */
|
50 | 80 | class SystemIOStreamClass extends SystemIOClass {
|
51 | 81 | SystemIOStreamClass() { this.hasName("Stream") }
|
|
0 commit comments