-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathSplitting.cs
More file actions
66 lines (62 loc) · 1.1 KB
/
Splitting.cs
File metadata and controls
66 lines (62 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
class Splitting
{
void M1(bool b, string tainted)
{
var x = tainted;
if (b)
{
Check(x);
if (x == null)
return;
}
Check(x);
if (b)
Check(x);
}
void M2(bool b)
{
var x = "";
if (b)
{
Check(x);
x = "taint source";
}
Check(x);
if (b)
Check(x);
else
Check(x);
}
void M3(bool b)
{
var x = "";
if (b)
x = "a";
x = "b";
Check(x);
Check(b ? x : "c");
Check((object)x);
Check(x = "d");
if (b)
return;
}
void M4(bool b)
{
var x = "";
if (b)
x = "abc";
var y = new string[] { "a" };
y[0] = "b";
x = x + y[0];
var z = x == "";
z = !z;
x = $"c{x}";
x = (x, y).Item1;
foreach (var s in y)
Check(s);
if (b)
return;
}
string Field;
static void Check<T>(T x) { }
}