Apply suggestions from code review

Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
This commit is contained in:
Tony Torralba
2023-07-21 11:18:55 +02:00
parent 3a6665b0ed
commit 0156fcc381
2 changed files with 21 additions and 3 deletions

View File

@@ -84,4 +84,22 @@ public class A {
sink(wrapper); // $ hasTaintFlow
}
public static InputStream wrapStream(InputStream in) {
return new InputStream() {
@Override
public int read() throws IOException {
return 0;
}
@Override
public int read(byte[] b) throws IOException {
return in.read(b);
}
};
}
public static void testWrapCall() {
sink(wrapStream(null)); // no flow
sink(wrapStream(source())); // $ hasTaintFlow
}
}