File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
swift/ql/test/library-tests/dataflow/taint/libraries Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,17 @@ class UIScene {
4141 class OpenURLOptions { }
4242}
4343
44+ struct CGFloat { }
45+
46+ class Data {
47+ init < S> ( _ elements: S ) { }
48+ }
49+
50+ class UIImage {
51+ init ? ( data: Data ) { }
52+ init ? ( data: Data , scale: CGFloat ) { }
53+ }
54+
4455// --- tests ---
4556
4657func source( _ label: String ) -> Any { return " " }
@@ -75,3 +86,12 @@ func testConnectionOptions() {
7586 sink ( safe. sourceApplication)
7687 sink ( tainted. sourceApplication)
7788}
89+
90+ func testUIImage( scale: CGFloat ) {
91+ let taintedData = source ( " UIImage " ) as! Data
92+
93+ sink ( UIImage ( data: Data ( 0 ) ) !)
94+ sink ( UIImage ( data: Data ( taintedData) ) !) // $ MISSING: tainted=UIImage
95+ sink ( UIImage ( data: Data ( 0 ) , scale: scale) !)
96+ sink ( UIImage ( data: Data ( taintedData) , scale: scale) !) // $ MISSING: tainted=UIImage
97+ }
You can’t perform that action at this time.
0 commit comments