Skip to content

Commit bca6cec

Browse files
author
Benjamin Muskalla
committed
Remove basic support for lambda flow
1 parent 78e3906 commit bca6cec

File tree

3 files changed

+2
-25
lines changed

3 files changed

+2
-25
lines changed

java/ql/src/utils/model-generator/CaptureSourceModels.ql

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,24 @@ class FromSourceConfiguration extends TaintTracking::Configuration {
2222

2323
override predicate isSink(DataFlow::Node sink) {
2424
exists(Callable c |
25-
sink instanceof ReturnNodeExt and
25+
sink instanceof ReturnNode and
2626
sink.getEnclosingCallable() = c and
2727
c.isPublic() and
2828
c.fromSource()
2929
)
30-
or
31-
exists(MethodAccess c | sink.asExpr() = c.getAnArgument())
3230
}
3331

3432
override DataFlow::FlowFeature getAFeature() {
3533
result instanceof DataFlow::FeatureHasSinkCallContext
3634
}
3735
}
3836

39-
string asOutput(DataFlow::Node node) {
40-
if node instanceof ReturnNodeExt
41-
then result = "ReturnValue"
42-
else
43-
result =
44-
"Parameter[" +
45-
node.(ArgumentNode)
46-
.getCall()
47-
.asCall()
48-
.getQualifier()
49-
.(VarAccess)
50-
.getVariable()
51-
.(Parameter)
52-
.getPosition() + "]"
53-
}
54-
5537
string captureSource(Callable api) {
5638
exists(DataFlow::Node source, DataFlow::Node sink, FromSourceConfiguration config, string kind |
5739
config.hasFlow(source, sink) and
5840
sourceNode(source, kind) and
5941
api = source.getEnclosingCallable() and
60-
result = asSourceModel(api, asOutput(sink), kind)
42+
result = asSourceModel(api, "ReturnValue", kind)
6143
)
6244
}
6345

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
| p;Sources;true;consumeSource;(int,Consumer);;Parameter[1];remote |
21
| p;Sources;true;readUrl;(URL);;ReturnValue;remote |
32
| p;Sources;true;socketStream;();;ReturnValue;remote |

java/ql/test/utils/model-generator/p/Sources.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,4 @@ public InputStream socketStream() throws IOException {
1818
return socket.accept().getInputStream();
1919
}
2020

21-
public void consumeSource(int port, Consumer<InputStream> consumer) throws IOException {
22-
ServerSocket socket = new ServerSocket(port);
23-
consumer.accept(socket.accept().getInputStream());
24-
}
2521
}

0 commit comments

Comments
 (0)