Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions csharp/ql/test/library-tests/dataflow/global/DataFlow.expected
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,33 @@
| Capture.cs:161:15:161:20 | access to local variable sink36 |
| Capture.cs:169:15:169:20 | access to local variable sink37 |
| Capture.cs:195:15:195:20 | access to local variable sink38 |
| GlobalDataFlow.cs:18:15:18:29 | access to field SinkField0 |
| GlobalDataFlow.cs:26:15:26:32 | access to property SinkProperty0 |
| GlobalDataFlow.cs:44:50:44:59 | access to parameter sinkParam2 |
| GlobalDataFlow.cs:71:15:71:19 | access to local variable sink0 |
| GlobalDataFlow.cs:73:15:73:19 | access to local variable sink1 |
| GlobalDataFlow.cs:76:15:76:19 | access to local variable sink2 |
| GlobalDataFlow.cs:79:15:79:19 | access to local variable sink3 |
| GlobalDataFlow.cs:136:15:136:19 | access to local variable sink4 |
| GlobalDataFlow.cs:144:15:144:19 | access to local variable sink5 |
| GlobalDataFlow.cs:154:15:154:19 | access to local variable sink6 |
| GlobalDataFlow.cs:157:15:157:19 | access to local variable sink7 |
| GlobalDataFlow.cs:160:15:160:19 | access to local variable sink8 |
| GlobalDataFlow.cs:164:15:164:20 | access to local variable sink23 |
| GlobalDataFlow.cs:181:15:181:19 | access to local variable sink9 |
| GlobalDataFlow.cs:190:15:190:20 | access to local variable sink10 |
| GlobalDataFlow.cs:198:15:198:20 | access to local variable sink19 |
| GlobalDataFlow.cs:239:15:239:24 | access to parameter sinkParam0 |
| GlobalDataFlow.cs:244:15:244:24 | access to parameter sinkParam1 |
| GlobalDataFlow.cs:249:15:249:24 | access to parameter sinkParam3 |
| GlobalDataFlow.cs:254:15:254:24 | access to parameter sinkParam4 |
| GlobalDataFlow.cs:259:15:259:24 | access to parameter sinkParam5 |
| GlobalDataFlow.cs:264:15:264:24 | access to parameter sinkParam6 |
| GlobalDataFlow.cs:269:15:269:24 | access to parameter sinkParam7 |
| GlobalDataFlow.cs:383:15:383:20 | access to local variable sink11 |
| GlobalDataFlow.cs:406:41:406:46 | access to local variable sink20 |
| GlobalDataFlow.cs:19:15:19:29 | access to field SinkField0 |
| GlobalDataFlow.cs:27:15:27:32 | access to property SinkProperty0 |
| GlobalDataFlow.cs:45:50:45:59 | access to parameter sinkParam2 |
| GlobalDataFlow.cs:72:15:72:19 | access to local variable sink0 |
| GlobalDataFlow.cs:74:15:74:19 | access to local variable sink1 |
| GlobalDataFlow.cs:77:15:77:19 | access to local variable sink2 |
| GlobalDataFlow.cs:80:15:80:19 | access to local variable sink3 |
| GlobalDataFlow.cs:137:15:137:19 | access to local variable sink4 |
| GlobalDataFlow.cs:145:15:145:19 | access to local variable sink5 |
| GlobalDataFlow.cs:155:15:155:19 | access to local variable sink6 |
| GlobalDataFlow.cs:158:15:158:19 | access to local variable sink7 |
| GlobalDataFlow.cs:161:15:161:19 | access to local variable sink8 |
| GlobalDataFlow.cs:165:15:165:20 | access to local variable sink23 |
| GlobalDataFlow.cs:182:15:182:19 | access to local variable sink9 |
| GlobalDataFlow.cs:191:15:191:20 | access to local variable sink10 |
| GlobalDataFlow.cs:199:15:199:20 | access to local variable sink19 |
| GlobalDataFlow.cs:239:15:239:20 | access to local variable sink41 |
| GlobalDataFlow.cs:241:15:241:20 | access to local variable sink42 |
| GlobalDataFlow.cs:255:15:255:24 | access to parameter sinkParam0 |
| GlobalDataFlow.cs:260:15:260:24 | access to parameter sinkParam1 |
| GlobalDataFlow.cs:265:15:265:24 | access to parameter sinkParam3 |
| GlobalDataFlow.cs:270:15:270:24 | access to parameter sinkParam4 |
| GlobalDataFlow.cs:275:15:275:24 | access to parameter sinkParam5 |
| GlobalDataFlow.cs:280:15:280:24 | access to parameter sinkParam6 |
| GlobalDataFlow.cs:285:15:285:24 | access to parameter sinkParam7 |
| GlobalDataFlow.cs:399:15:399:20 | access to local variable sink11 |
| GlobalDataFlow.cs:422:41:422:46 | access to local variable sink20 |
| Splitting.cs:9:15:9:15 | [b (line 3): false] access to local variable x |
| Splitting.cs:9:15:9:15 | [b (line 3): true] access to local variable x |
| Splitting.cs:11:19:11:19 | access to local variable x |
Expand Down
515 changes: 261 additions & 254 deletions csharp/ql/test/library-tests/dataflow/global/DataFlowPath.expected

Large diffs are not rendered by default.

332 changes: 168 additions & 164 deletions csharp/ql/test/library-tests/dataflow/global/GetAnOutNode.expected

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions csharp/ql/test/library-tests/dataflow/global/GlobalDataFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

/// <summary>
/// All (tainted) sinks are named `sink[Param|Field|Property]N`, for some N, and all
Expand Down Expand Up @@ -231,6 +232,21 @@ public void M2()
Check(nonSink);
}

public async void M3()
{
// async await, tainted
var sink41 = Task.Run(() => "taint source");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to sink0?

Check(sink41);
var sink42 = await sink41;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to sink1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sink0 and sink1 are already used in another test, so that's why I went for the next available numbers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, okay!

Check(sink42);

// async await, not tainted
var nonSink0 = Task.Run(() => "");
Check(nonSink0);
var nonSink1 = await nonSink0;
Check(nonSink1);
}

static void Check<T>(T x) { }

static void In0<T>(T sinkParam0)
Expand Down
84 changes: 43 additions & 41 deletions csharp/ql/test/library-tests/dataflow/global/TaintTracking.expected
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,49 @@
| Capture.cs:161:15:161:20 | access to local variable sink36 |
| Capture.cs:169:15:169:20 | access to local variable sink37 |
| Capture.cs:195:15:195:20 | access to local variable sink38 |
| GlobalDataFlow.cs:18:15:18:29 | access to field SinkField0 |
| GlobalDataFlow.cs:26:15:26:32 | access to property SinkProperty0 |
| GlobalDataFlow.cs:44:50:44:59 | access to parameter sinkParam2 |
| GlobalDataFlow.cs:71:15:71:19 | access to local variable sink0 |
| GlobalDataFlow.cs:73:15:73:19 | access to local variable sink1 |
| GlobalDataFlow.cs:76:15:76:19 | access to local variable sink2 |
| GlobalDataFlow.cs:79:15:79:19 | access to local variable sink3 |
| GlobalDataFlow.cs:81:15:81:20 | access to local variable sink13 |
| GlobalDataFlow.cs:83:15:83:20 | access to local variable sink14 |
| GlobalDataFlow.cs:85:15:85:20 | access to local variable sink15 |
| GlobalDataFlow.cs:87:15:87:20 | access to local variable sink16 |
| GlobalDataFlow.cs:89:15:89:20 | access to local variable sink17 |
| GlobalDataFlow.cs:91:15:91:20 | access to local variable sink18 |
| GlobalDataFlow.cs:94:15:94:20 | access to local variable sink21 |
| GlobalDataFlow.cs:97:15:97:20 | access to local variable sink22 |
| GlobalDataFlow.cs:136:15:136:19 | access to local variable sink4 |
| GlobalDataFlow.cs:144:15:144:19 | access to local variable sink5 |
| GlobalDataFlow.cs:154:15:154:19 | access to local variable sink6 |
| GlobalDataFlow.cs:157:15:157:19 | access to local variable sink7 |
| GlobalDataFlow.cs:160:15:160:19 | access to local variable sink8 |
| GlobalDataFlow.cs:162:15:162:20 | access to local variable sink12 |
| GlobalDataFlow.cs:164:15:164:20 | access to local variable sink23 |
| GlobalDataFlow.cs:181:15:181:19 | access to local variable sink9 |
| GlobalDataFlow.cs:190:15:190:20 | access to local variable sink10 |
| GlobalDataFlow.cs:198:15:198:20 | access to local variable sink19 |
| GlobalDataFlow.cs:210:58:210:68 | access to parameter sinkParam10 |
| GlobalDataFlow.cs:213:15:213:20 | access to local variable sink24 |
| GlobalDataFlow.cs:215:15:215:20 | access to local variable sink25 |
| GlobalDataFlow.cs:217:15:217:20 | access to local variable sink26 |
| GlobalDataFlow.cs:239:15:239:24 | access to parameter sinkParam0 |
| GlobalDataFlow.cs:244:15:244:24 | access to parameter sinkParam1 |
| GlobalDataFlow.cs:249:15:249:24 | access to parameter sinkParam3 |
| GlobalDataFlow.cs:254:15:254:24 | access to parameter sinkParam4 |
| GlobalDataFlow.cs:259:15:259:24 | access to parameter sinkParam5 |
| GlobalDataFlow.cs:264:15:264:24 | access to parameter sinkParam6 |
| GlobalDataFlow.cs:269:15:269:24 | access to parameter sinkParam7 |
| GlobalDataFlow.cs:296:15:296:24 | access to parameter sinkParam8 |
| GlobalDataFlow.cs:302:15:302:24 | access to parameter sinkParam9 |
| GlobalDataFlow.cs:308:15:308:25 | access to parameter sinkParam11 |
| GlobalDataFlow.cs:383:15:383:20 | access to local variable sink11 |
| GlobalDataFlow.cs:406:41:406:46 | access to local variable sink20 |
| GlobalDataFlow.cs:19:15:19:29 | access to field SinkField0 |
| GlobalDataFlow.cs:27:15:27:32 | access to property SinkProperty0 |
| GlobalDataFlow.cs:45:50:45:59 | access to parameter sinkParam2 |
| GlobalDataFlow.cs:72:15:72:19 | access to local variable sink0 |
| GlobalDataFlow.cs:74:15:74:19 | access to local variable sink1 |
| GlobalDataFlow.cs:77:15:77:19 | access to local variable sink2 |
| GlobalDataFlow.cs:80:15:80:19 | access to local variable sink3 |
| GlobalDataFlow.cs:82:15:82:20 | access to local variable sink13 |
| GlobalDataFlow.cs:84:15:84:20 | access to local variable sink14 |
| GlobalDataFlow.cs:86:15:86:20 | access to local variable sink15 |
| GlobalDataFlow.cs:88:15:88:20 | access to local variable sink16 |
| GlobalDataFlow.cs:90:15:90:20 | access to local variable sink17 |
| GlobalDataFlow.cs:92:15:92:20 | access to local variable sink18 |
| GlobalDataFlow.cs:95:15:95:20 | access to local variable sink21 |
| GlobalDataFlow.cs:98:15:98:20 | access to local variable sink22 |
| GlobalDataFlow.cs:137:15:137:19 | access to local variable sink4 |
| GlobalDataFlow.cs:145:15:145:19 | access to local variable sink5 |
| GlobalDataFlow.cs:155:15:155:19 | access to local variable sink6 |
| GlobalDataFlow.cs:158:15:158:19 | access to local variable sink7 |
| GlobalDataFlow.cs:161:15:161:19 | access to local variable sink8 |
| GlobalDataFlow.cs:163:15:163:20 | access to local variable sink12 |
| GlobalDataFlow.cs:165:15:165:20 | access to local variable sink23 |
| GlobalDataFlow.cs:182:15:182:19 | access to local variable sink9 |
| GlobalDataFlow.cs:191:15:191:20 | access to local variable sink10 |
| GlobalDataFlow.cs:199:15:199:20 | access to local variable sink19 |
| GlobalDataFlow.cs:211:58:211:68 | access to parameter sinkParam10 |
| GlobalDataFlow.cs:214:15:214:20 | access to local variable sink24 |
| GlobalDataFlow.cs:216:15:216:20 | access to local variable sink25 |
| GlobalDataFlow.cs:218:15:218:20 | access to local variable sink26 |
| GlobalDataFlow.cs:239:15:239:20 | access to local variable sink41 |
| GlobalDataFlow.cs:241:15:241:20 | access to local variable sink42 |
| GlobalDataFlow.cs:255:15:255:24 | access to parameter sinkParam0 |
| GlobalDataFlow.cs:260:15:260:24 | access to parameter sinkParam1 |
| GlobalDataFlow.cs:265:15:265:24 | access to parameter sinkParam3 |
| GlobalDataFlow.cs:270:15:270:24 | access to parameter sinkParam4 |
| GlobalDataFlow.cs:275:15:275:24 | access to parameter sinkParam5 |
| GlobalDataFlow.cs:280:15:280:24 | access to parameter sinkParam6 |
| GlobalDataFlow.cs:285:15:285:24 | access to parameter sinkParam7 |
| GlobalDataFlow.cs:312:15:312:24 | access to parameter sinkParam8 |
| GlobalDataFlow.cs:318:15:318:24 | access to parameter sinkParam9 |
| GlobalDataFlow.cs:324:15:324:25 | access to parameter sinkParam11 |
| GlobalDataFlow.cs:399:15:399:20 | access to local variable sink11 |
| GlobalDataFlow.cs:422:41:422:46 | access to local variable sink20 |
| Splitting.cs:9:15:9:15 | [b (line 3): false] access to local variable x |
| Splitting.cs:9:15:9:15 | [b (line 3): true] access to local variable x |
| Splitting.cs:11:19:11:19 | access to local variable x |
Expand Down
Loading