mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Swift: Add test case.
This commit is contained in:
@@ -76,7 +76,7 @@ struct URLRequest {}
|
||||
|
||||
// --- tests ---
|
||||
|
||||
func source() -> Any { return "" }
|
||||
func source(_ label: String? = "") -> Any { return "" }
|
||||
func sink(_: Any) {}
|
||||
|
||||
func testInheritBodyTaint() {
|
||||
@@ -146,6 +146,9 @@ func testWKUserScript() {
|
||||
}
|
||||
|
||||
func testWKNavigationAction() {
|
||||
let src = source() as! WKNavigationAction
|
||||
sink(src.request) // $ tainted=149
|
||||
}
|
||||
let src = source("WKNavigationAction") as! WKNavigationAction
|
||||
sink(src.request) // $ tainted=WKNavigationAction
|
||||
|
||||
let keypath = \WKNavigationAction.request
|
||||
sink(src[keyPath: keypath]) // $ MISSING: tainted=WKNavigationAction
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user