Skip to content

Commit b8d29e8

Browse files
committed
Swift: Add a more realistic test case as well.
1 parent aeeafd7 commit b8d29e8

File tree

1 file changed

+9
-1
lines changed
  • swift/ql/test/library-tests/dataflow/flowsources

1 file changed

+9
-1
lines changed

swift/ql/test/library-tests/dataflow/flowsources/uikit.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ class MyUITextFieldDelegate : UITextFieldDelegate {
7070
}
7171
}
7272

73-
func test(textField: UITextField, searchTextField: UISearchTextField, myTextInput: MyTextInput, range: UITextRange) {
73+
func test(
74+
textField: UITextField,
75+
searchTextField: UISearchTextField,
76+
myTextInput: MyTextInput,
77+
range: UITextRange,
78+
protocolTextInput: UITextInput) {
7479
_ = textField.text // $ source=local
7580
_ = textField.attributedText // $ source=local
7681
_ = textField.placeholder // GOOD (not input)
@@ -79,4 +84,7 @@ func test(textField: UITextField, searchTextField: UISearchTextField, myTextInpu
7984

8085
_ = myTextInput.text(in: range)! // $ source=local
8186
_ = myTextInput.harmless(in: range)! // GOOD (not input)
87+
88+
let str = protocolTextInput.text(in: range)! // $ source=local
89+
sink(arg: str) // $ MISSING: tainted
8290
}

0 commit comments

Comments
 (0)