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 {
41
41
class OpenURLOptions { }
42
42
}
43
43
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
+
44
55
// --- tests ---
45
56
46
57
func source( _ label: String ) -> Any { return " " }
@@ -75,3 +86,12 @@ func testConnectionOptions() {
75
86
sink ( safe. sourceApplication)
76
87
sink ( tainted. sourceApplication)
77
88
}
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