mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Swift: Add tests for UIImage.
This commit is contained in:
@@ -41,6 +41,17 @@ class UIScene {
|
||||
class OpenURLOptions {}
|
||||
}
|
||||
|
||||
struct CGFloat { }
|
||||
|
||||
class Data {
|
||||
init<S>(_ elements: S) {}
|
||||
}
|
||||
|
||||
class UIImage {
|
||||
init?(data: Data) { }
|
||||
init?(data: Data, scale: CGFloat) { }
|
||||
}
|
||||
|
||||
// --- tests ---
|
||||
|
||||
func source(_ label: String) -> Any { return "" }
|
||||
@@ -75,3 +86,12 @@ func testConnectionOptions() {
|
||||
sink(safe.sourceApplication)
|
||||
sink(tainted.sourceApplication)
|
||||
}
|
||||
|
||||
func testUIImage(scale: CGFloat) {
|
||||
let taintedData = source("UIImage") as! Data
|
||||
|
||||
sink(UIImage(data: Data(0))!)
|
||||
sink(UIImage(data: Data(taintedData))!) // $ MISSING: tainted=UIImage
|
||||
sink(UIImage(data: Data(0), scale: scale)!)
|
||||
sink(UIImage(data: Data(taintedData), scale: scale)!) // $ MISSING: tainted=UIImage
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user