Skip to content

Commit 3573dd6

Browse files
committed
Swift: Address review comments.
1 parent c3c86a7 commit 3573dd6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

swift/ql/src/queries/Security/CWE-311/CleartextStorageDatabase.ql

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ import codeql.swift.dataflow.TaintTracking
1818
import DataFlow::PathGraph
1919

2020
/**
21-
* An `Expr` that is stored in a local database.
21+
* A `DataFlow::Node` that is something stored in a local database.
2222
*/
2323
abstract class Stored extends DataFlow::Node { }
2424

2525
/**
26-
* An `Expr` that is stored with the Core Data library.
26+
* A `DataFlow::Node` that is an expression stored with the Core Data library.
2727
*/
2828
class CoreDataStore extends Stored {
2929
CoreDataStore() {
@@ -39,16 +39,17 @@ class CoreDataStore extends Stored {
3939
}
4040

4141
/**
42-
* An `Expr` that is stored with the Realm database library.
42+
* A `DataFlow::Node` that is an expression stored with the Realm database
43+
* library.
4344
*/
44-
class RealmStore extends Stored {
45+
class RealmStore extends Stored instanceof DataFlow::PostUpdateNode {
4546
RealmStore() {
4647
// any write into a class derived from `RealmSwiftObject` is a sink. For
4748
// example in `realmObj.data = sensitive` the post-update node corresponding
4849
// with `realmObj.data` is a sink.
4950
exists(ClassDecl cd, Expr e |
5051
cd.getABaseTypeDecl*().getName() = "RealmSwiftObject" and
51-
this.(DataFlow::PostUpdateNode).getPreUpdateNode().asExpr() = e and
52+
this.getPreUpdateNode().asExpr() = e and
5253
e.getFullyConverted().getType() = cd.getType() and
5354
not e.(DeclRefExpr).getDecl() instanceof SelfParamDecl
5455
)

0 commit comments

Comments
 (0)