mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Add dataflow test for property reference being used as lambda
This commit is contained in:
@@ -10,5 +10,10 @@ class FunctionReference {
|
||||
Helper.sink(Processor().process(this::fn1, Helper.notaint()))
|
||||
Helper.sink(Processor().process(::fn2, Helper.taint()))
|
||||
Helper.sink(Processor().process(::fn2, Helper.notaint()))
|
||||
|
||||
Helper.sink(Processor().process(this::prop))
|
||||
}
|
||||
|
||||
val prop: String
|
||||
get() = Helper.taint()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
| functionReference.kt:8:59:8:65 | taint(...) | functionReference.kt:8:33:8:66 | process(...) |
|
||||
| functionReference.kt:9:78:9:84 | taint(...) | functionReference.kt:9:33:9:85 | process(...) |
|
||||
| functionReference.kt:11:55:11:61 | taint(...) | functionReference.kt:11:33:11:62 | process(...) |
|
||||
| functionReference.kt:18:24:18:30 | taint(...) | functionReference.kt:14:33:14:51 | process(...) |
|
||||
| lambda.kt:4:64:4:70 | taint(...) | lambda.kt:4:33:4:77 | process(...) |
|
||||
| lambda.kt:5:60:5:66 | taint(...) | lambda.kt:5:33:5:67 | process(...) |
|
||||
| lambda.kt:6:69:6:75 | taint(...) | lambda.kt:6:33:6:76 | process(...) |
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
class Processor {
|
||||
fun <R> process(f: () -> R) : R {
|
||||
return f()
|
||||
}
|
||||
|
||||
fun <T, R> process(f: (T) -> R, arg: T) : R {
|
||||
return f(arg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user