-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathTest.java
More file actions
177 lines (171 loc) · 6.83 KB
/
Test.java
File metadata and controls
177 lines (171 loc) · 6.83 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
package generatedtest;
import java.util.logging.LogRecord;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.EntryMessage;
import org.apache.logging.log4j.message.Message;
import org.slf4j.spi.LoggingEventBuilder;
// Test case originally generated by GenerateFlowTestCase.ql
// Subsequently modified manually.
public class Test {
Object source() {
return null;
}
void sink(Object o) {}
public void test() throws Exception {
{
// "java.util.logging;LogRecord;false;LogRecord;;;Argument[1];Argument[this];taint;manual"
LogRecord out = null;
String in = (String) source();
out = new LogRecord(null, in);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(Message);;Argument[0];ReturnValue;taint;manual"
EntryMessage out = null;
Message in = (Message) source();
Logger instance = null;
out = instance.traceEntry(in);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(String,Object[]);;Argument[0..1];ReturnValue;taint;manual"
EntryMessage out = null;
Object[] in = (Object[]) source();
Logger instance = null;
out = instance.traceEntry((String) null, in);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(String,Object[]);;Argument[0..1];ReturnValue;taint;manual"
EntryMessage out = null;
String in = (String) source();
Logger instance = null;
out = instance.traceEntry(in, (Object[]) null);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(String,Supplier[]);;Argument[0..1];ReturnValue;taint;manual"
EntryMessage out = null;
String in = (String) source();
Logger instance = null;
out = instance.traceEntry(in, (org.apache.logging.log4j.util.Supplier[]) null);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(String,Supplier[]);;Argument[0..1];ReturnValue;taint;manual"
EntryMessage out = null;
org.apache.logging.log4j.util.Supplier[] in =
(org.apache.logging.log4j.util.Supplier[]) source();
Logger instance = null;
out = instance.traceEntry((String) null, in);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(Supplier[]);;Argument[0];ReturnValue;taint;manual"
EntryMessage out = null;
org.apache.logging.log4j.util.Supplier[] in =
(org.apache.logging.log4j.util.Supplier[]) source();
Logger instance = null;
out = instance.traceEntry(in);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceExit;(EntryMessage,Object);;Argument[1];ReturnValue;value;manual"
Object out = null;
Object in = (Object) source();
Logger instance = null;
out = instance.traceExit((EntryMessage) null, in);
sink(out); // $ hasValueFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceExit;(Message,Object);;Argument[1];ReturnValue;value;manual"
Object out = null;
Object in = (Object) source();
Logger instance = null;
out = instance.traceExit((Message) null, in);
sink(out); // $ hasValueFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceExit;(Object);;Argument[0];ReturnValue;value;manual"
Object out = null;
Object in = (Object) source();
Logger instance = null;
out = instance.traceExit(in);
sink(out); // $ hasValueFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceExit;(String,Object);;Argument[1];ReturnValue;value;manual"
Object out = null;
Object in = (Object) source();
Logger instance = null;
out = instance.traceExit((String) null, in);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addArgument;;;Argument[this];ReturnValue;value;manual"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.addArgument((Object) null);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addArgument;;;Argument[this];ReturnValue;value;manual"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.addArgument((java.util.function.Supplier) null);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[this];ReturnValue;value;manual"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.addKeyValue((String) null, (Object) null);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[this];ReturnValue;value;manual"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.addKeyValue((String) null, (java.util.function.Supplier) null);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[1];Argument[this];taint;manual"
LoggingEventBuilder out = null;
Object in = (Object) source();
out.addKeyValue((String) null, in);
sink(out); // $ hasTaintFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[1];Argument[this];taint;manual"
LoggingEventBuilder out = null;
java.util.function.Supplier in = (java.util.function.Supplier) source();
out.addKeyValue((String) null, in);
sink(out); // $ hasTaintFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addMarker;;;Argument[this];ReturnValue;value;manual"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.addMarker(null);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;setCause;;;Argument[this];ReturnValue;value;manual"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.setCause(null);
sink(out); // $ hasValueFlow
}
{
// "java.util.logging;LogRecord;true;getParameters;();;Argument[this].SyntheticField[java.util.logging.LogRecord.parameters].ArrayElement;ReturnValue.ArrayElement;value;manual
// "java.util.logging;LogRecord;true;setParameters;(Object[]);Argument[0].ArrayElement;Argument[this].SyntheticField[java.util.logging.LogRecord.parameters].ArrayElement;value;manual
LogRecord record = new LogRecord(null, null);
Object[] parameters = new Object[1];
parameters[0] = source();
record.setParameters(parameters);
Object[] out = record.getParameters();
sink(out[0]); // $ hasValueFlow
}
}
}