Skip to content

Commit cd0f329

Browse files
committed
unified: Add tests for explicit '.init' at constructor call
1 parent df72e5e commit cd0f329

2 files changed

Lines changed: 30 additions & 16 deletions

File tree

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
isSink
2-
| test.swift:8:28:8:33 | string | path-injection |
3-
| test.swift:10:25:10:30 | string | path-injection |
4-
| test.swift:13:25:13:30 | string | path-injection |
5-
| test.swift:17:17:17:22 | string | path-injection |
6-
| test.swift:20:5:20:16 | [receiver arg] ... .md5(...) | weak-hash-input-MD5 |
7-
| test.swift:22:20:22:25 | string | regex-use |
2+
| test.swift:9:28:9:33 | string | path-injection |
3+
| test.swift:11:25:11:30 | string | path-injection |
4+
| test.swift:14:25:14:30 | string | path-injection |
5+
| test.swift:18:17:18:22 | string | path-injection |
6+
| test.swift:21:5:21:16 | [receiver arg] ... .md5(...) | weak-hash-input-MD5 |
87
| test.swift:23:20:23:25 | string | regex-use |
9-
| test.swift:70:37:70:49 | encodedOffset | string-length |
10-
| test.swift:74:24:74:36 | encryptionKey | encryption-key |
11-
| test.swift:75:18:75:24 | fileURL | path-injection |
12-
| test.swift:86:24:86:36 | encryptionKey | encryption-key |
13-
| test.swift:87:18:87:24 | fileURL | path-injection |
14-
| test.swift:93:23:93:34 | seedFilePath | path-injection |
8+
| test.swift:24:20:24:25 | string | regex-use |
9+
| test.swift:71:37:71:49 | encodedOffset | string-length |
10+
| test.swift:76:24:76:36 | encryptionKey | encryption-key |
11+
| test.swift:77:18:77:24 | fileURL | path-injection |
12+
| test.swift:100:24:100:36 | encryptionKey | encryption-key |
13+
| test.swift:101:18:101:24 | fileURL | path-injection |
14+
| test.swift:107:23:107:34 | seedFilePath | path-injection |
1515
isSource
1616
| test.swift:4:5:4:27 | String(...) | remote |
1717
| test.swift:5:5:5:44 | String(...) | remote |
1818
| test.swift:6:5:6:48 | String(...) | remote |
19-
| test.swift:8:5:8:34 | String(...) | local |
20-
| test.swift:9:5:11:24 | String(...) | local |
21-
| test.swift:12:5:14:28 | String(...) | local |
22-
| test.swift:28:29:28:32 | text | local |
19+
| test.swift:9:5:9:34 | String(...) | local |
20+
| test.swift:10:5:12:24 | String(...) | local |
21+
| test.swift:13:5:15:28 | String(...) | local |
22+
| test.swift:29:29:29:32 | text | local |

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ func test(url: URL, string: String) {
44
String(contentsOf: url) // $ isSource=remote
55
String(contentsOf: url, encoding: .utf8) // $ isSource=remote
66
String(contentsOf: url, usedEncoding: .utf8) // $ isSource=remote
7+
String.init(contentsOf: url) // $ MISSING: isSource=remote
78

89
String(contentsOfFile: string) // $ isSource=local isSink=path-injection
910
String(
@@ -68,6 +69,7 @@ func testQualifiedConstructors(
6869
seedFilePath: String
6970
) {
7071
_ = String.Index(encodedOffset: encodedOffset) // $ isSink=string-length
72+
_ = String.Index.init(encodedOffset: encodedOffset) // $ MISSING: isSink=string-length
7173

7274
_ = Realm.Configuration(
7375
deleteRealmIfMigrationNeeded: false,
@@ -81,6 +83,18 @@ func testQualifiedConstructors(
8183
shouldCompactOnLaunch: nil,
8284
syncConfiguration: nil)
8385

86+
_ = Realm.Configuration.init(
87+
deleteRealmIfMigrationNeeded: false,
88+
encryptionKey: encryptionKey, // $ MISSING: isSink=encryption-key
89+
fileURL: fileURL, // $ MISSING: isSink=path-injection
90+
inMemoryIdentifier: nil,
91+
migrationBlock: nil,
92+
objectTypes: nil,
93+
readOnly: false,
94+
schemaVersion: 0,
95+
shouldCompactOnLaunch: nil,
96+
syncConfiguration: nil)
97+
8498
_ = Realm.Configuration(
8599
deleteRealmIfMigrationNeeded: false,
86100
encryptionKey: encryptionKey, // $ isSink=encryption-key

0 commit comments

Comments
 (0)