Skip to content

Commit e59d7e0

Browse files
committed
Swift: Remove assumption that 'username' is not sensitive (in the tests).
1 parent dba9511 commit e59d7e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

swift/ql/test/query-tests/Security/CWE-311/testRealm.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ class MyRealmSwiftObject : RealmSwiftObject {
3030
class MyRealmSwiftObject2 : Object {
3131
override init() { password = "" }
3232

33-
var username: String?
33+
var harmless: String?
3434
var password: String?
3535
}
3636

37-
func test1(realm : Realm, myUsername: String, myPassword : String, myHashedPassword : String) {
37+
func test1(realm : Realm, myHarmless: String, myPassword : String, myHashedPassword : String) {
3838
// add objects (within a transaction) ...
3939

4040
let a = MyRealmSwiftObject()
@@ -69,7 +69,7 @@ func test1(realm : Realm, myUsername: String, myPassword : String, myHashedPassw
6969
// MyRealmSwiftObject2...
7070

7171
let h = MyRealmSwiftObject2()
72-
h.username = myUsername // GOOD (not sensitive)
72+
h.harmless = myHarmless // GOOD (not sensitive)
7373
h.password = myPassword // BAD
7474
realm.add(h)
7575
}

0 commit comments

Comments
 (0)