mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Add additional tests for http stuff + corresponding stubs
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import io.netty.channel.*;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
// import io.netty.handler.codec.*;
|
||||
// import io.netty.handler.codec.http.*;
|
||||
import io.netty.handler.codec.*;
|
||||
import io.netty.handler.codec.http.*;
|
||||
import io.netty.handler.codec.http2.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
class Test {
|
||||
static <T> T source() { return null; }
|
||||
@@ -28,4 +31,46 @@ class Test {
|
||||
sink(bb); // $ hasTaintFlow
|
||||
sink(x);
|
||||
}
|
||||
|
||||
class C extends ByteToMessageDecoder {
|
||||
public void callDecode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) {
|
||||
sink(msg); // $ hasTaintFlow
|
||||
}
|
||||
|
||||
public void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) {
|
||||
sink(msg); // $ hasTaintFlow
|
||||
}
|
||||
|
||||
public void decodeLast(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) {
|
||||
sink(msg); // $ hasTaintFlow
|
||||
}
|
||||
}
|
||||
|
||||
class D extends SimpleChannelInboundHandler<FullHttpRequest> {
|
||||
public void channelRead0(ChannelHandlerContext ctx, FullHttpRequest msg) {
|
||||
sink(msg.uri()); // $ hasTaintFlow
|
||||
sink(msg.headers().get("X-blah")); // $ hasTaintFlow
|
||||
sink(msg.content()); // $ hasTaintFlow
|
||||
}
|
||||
}
|
||||
|
||||
class E extends Http2FrameAdapter {
|
||||
public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) {
|
||||
sink(data); // $ hasTaintFlow
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream) {
|
||||
sink(headers.get("X-blah")); // $ hasTaintFlow
|
||||
sink(headers.path()); // $ hasTaintFlow
|
||||
}
|
||||
|
||||
public void onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding) {
|
||||
sink(headers); // $ hasTaintFlow
|
||||
}
|
||||
|
||||
public void onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload) {
|
||||
sink(payload); // $ hasTaintFlow
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user