mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Add support for Promise.value and Promise::flatMap
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
import ratpack.core.handling.Context;
|
||||
import ratpack.core.http.TypedData;
|
||||
import ratpack.core.form.UploadedFile;
|
||||
import ratpack.exec.Promise;
|
||||
import java.io.OutputStream;
|
||||
|
||||
class Resource {
|
||||
|
||||
void sink(Object o) {}
|
||||
|
||||
String taint() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void test1(Context ctx) {
|
||||
sink(ctx.getRequest().getContentLength()); //$hasTaintFlow
|
||||
sink(ctx.getRequest().getCookies()); //$hasTaintFlow
|
||||
@@ -53,4 +58,14 @@ class Resource {
|
||||
.next(this::sink) //$hasTaintFlow
|
||||
.then(this::sink); //$hasTaintFlow
|
||||
}
|
||||
|
||||
void test6() {
|
||||
String tainted = taint();
|
||||
Promise.value(tainted);
|
||||
sink(Promise.value(tainted)); //$hasTaintFlow
|
||||
Promise
|
||||
.value(tainted)
|
||||
.flatMap(a -> Promise.value(a))
|
||||
.then(this::sink); //$hasTaintFlow
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user