Skip to content

Commit 56d5444

Browse files
committed
unified: Document lack of support for properties
1 parent 67a9562 commit 56d5444

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

‎unified/ql/lib/codeql/unified/internal/mad/LegacyMaD.qll‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ private predicate modelContainsMethodName(string name) {
2929
}
3030

3131
private predicate parsedRawMethodName(string rawName, string name, string argLabels) {
32+
// NOTE: We only support method names at the moment, not property names like `String.count`.
3233
modelContainsMethodName(rawName) and
3334
exists(string regex |
3435
regex = "([^(]+)\\((.*)\\)" and

‎unified/ql/test/library-tests/mad/test.swift‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,28 @@ func test(url: URL, string: String) {
3131
}
3232
}
3333
}
34+
35+
class UITextField {
36+
var text: String = ""
37+
}
38+
39+
class URLSessionConfiguration {
40+
var tlsMaximumSupportedProtocol: Int = 0
41+
var tlsMinimumSupportedProtocol: Int = 0
42+
var tlsMaximumSupportedProtocolVersion: Int = 0
43+
var tlsMinimumSupportedProtocolVersion: Int = 0
44+
}
45+
46+
func testProperties(
47+
string: String,
48+
textField: UITextField,
49+
configuration: URLSessionConfiguration
50+
) {
51+
_ = string.count // $ MISSING: isSource=string-length
52+
_ = textField.text // $ MISSING: isSource=local
53+
54+
configuration.tlsMaximumSupportedProtocol = 0 // $ MISSING: isSink=tls-protocol-version
55+
configuration.tlsMinimumSupportedProtocol = 0 // $ MISSING: isSink=tls-protocol-version
56+
configuration.tlsMaximumSupportedProtocolVersion = 0 // $ MISSING: isSink=tls-protocol-version
57+
configuration.tlsMinimumSupportedProtocolVersion = 0 // $ MISSING: isSink=tls-protocol-version
58+
}

0 commit comments

Comments
 (0)