We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3bda9af commit 242dc80Copy full SHA for 242dc80
swift/ql/test/library-tests/dataflow/taint/try.swift
@@ -0,0 +1,19 @@
1
+func clean() throws -> String { return ""; }
2
+func source() throws -> String { return ""; }
3
+func sink(arg: String) {}
4
+
5
+func taintThroughTry() {
6
+ do
7
+ {
8
+ sink(arg: try clean())
9
+ sink(arg: try source()) // tainted [NOT DETECTED]
10
+ } catch {
11
+ // ...
12
+ }
13
14
+ sink(arg: try! clean())
15
+ sink(arg: try! source()) // tainted [NOT DETECTED]
16
17
+ sink(arg: (try? clean())!)
18
+ sink(arg: (try? source())!) // tainted [NOT DETECTED]
19
+}
0 commit comments