mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
12 lines
265 B
Kotlin
12 lines
265 B
Kotlin
import java.io.Closeable
|
|
|
|
class UseFlowTest {
|
|
fun <T> taint(t: T) = t
|
|
fun sink(s: Closeable) { }
|
|
|
|
fun test(input: Closeable) {
|
|
taint(input).use { it -> sink(it) } // $ hasValueFlow
|
|
sink(taint(input).use { it }) // $ hasValueFlow
|
|
}
|
|
}
|