Skip to content

Commit 3e4a6be

Browse files
committed
Swift: Add missing test annotations.
1 parent 430a8e1 commit 3e4a6be

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ func test2(obj : MyManagedObject, password : String, password_file : String) {
5858
obj.setValue(password, forKey: "myKey") // BAD
5959
obj.setValue(password_file, forKey: "myKey") // GOOD (not sensitive)
6060

61-
obj.setIndirect(value: password) // BAD
61+
obj.setIndirect(value: password) // BAD [reported on line 19]
6262
obj.setIndirect(value: password_file) // GOOD (not sensitive)
6363

64-
obj.myValue = password // BAD
64+
obj.myValue = password // BAD [reported on line 32]
6565
obj.myValue = password_file // GOOD (not sensitive)
6666
}
6767

@@ -73,7 +73,7 @@ class MyClass {
7373
func test3(obj : NSManagedObject, x : String) {
7474
// alternative evidence of sensitivity...
7575

76-
obj.setValue(x, forKey: "myKey") // BAD
76+
obj.setValue(x, forKey: "myKey") // BAD [NOT REPORTED]
7777
doSomething(password: x);
7878
obj.setValue(x, forKey: "myKey") // BAD
7979

@@ -100,7 +100,7 @@ func test4(obj : NSManagedObject, passwd : String) {
100100
hash(data: &y);
101101
z = "";
102102

103-
obj.setValue(x, forKey: "myKey") // GOOD (not sensitive)
104-
obj.setValue(y, forKey: "myKey") // GOOD (not sensitive)
103+
obj.setValue(x, forKey: "myKey") // GOOD (not sensitive) [FALSE POSITIVE]
104+
obj.setValue(y, forKey: "myKey") // GOOD (not sensitive) [FALSE POSITIVE]
105105
obj.setValue(z, forKey: "myKey") // GOOD (not sensitive)
106106
}

0 commit comments

Comments
 (0)