Skip to content

Commit 892beea

Browse files
committed
Swift: Add test case.
1 parent 8be6aed commit 892beea

File tree

1 file changed

+7
-4
lines changed
  • swift/ql/test/library-tests/dataflow/taint/libraries

1 file changed

+7
-4
lines changed

swift/ql/test/library-tests/dataflow/taint/libraries/webview.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct URLRequest {}
7676

7777
// --- tests ---
7878

79-
func source() -> Any { return "" }
79+
func source(_ label: String? = "") -> Any { return "" }
8080
func sink(_: Any) {}
8181

8282
func testInheritBodyTaint() {
@@ -146,6 +146,9 @@ func testWKUserScript() {
146146
}
147147

148148
func testWKNavigationAction() {
149-
let src = source() as! WKNavigationAction
150-
sink(src.request) // $ tainted=149
151-
}
149+
let src = source("WKNavigationAction") as! WKNavigationAction
150+
sink(src.request) // $ tainted=WKNavigationAction
151+
152+
let keypath = \WKNavigationAction.request
153+
sink(src[keyPath: keypath]) // $ MISSING: tainted=WKNavigationAction
154+
}

0 commit comments

Comments
 (0)