Skip to content

Commit fdcc6b4

Browse files
committed
Swift: Simplify allowImplicitRead slightly.
1 parent 7ddece1 commit fdcc6b4

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

swift/ql/lib/codeql/swift/security/CleartextStorageDatabaseQuery.qll

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,13 @@ module CleartextStorageDatabaseConfig implements DataFlow::ConfigSig {
4040
c.getAReadContent().(DataFlow::Content::FieldContent).getField() = cx.getAMember()
4141
)
4242
or
43-
// flow out from dictionary values at the sink (this is essential for some of the
44-
// SQLite.swift models)
43+
// flow out from dictionary tuple values at the sink (this is essential
44+
// for some of the SQLite.swift models).
4545
isSink(node) and
4646
node.asExpr().getType().getUnderlyingType() instanceof DictionaryType and
47-
(
48-
c.getAReadContent() instanceof DataFlow::Content::CollectionContent or
49-
c.getAReadContent().(DataFlow::Content::TupleContent).getIndex() = 1
50-
)
47+
c.getAReadContent().(DataFlow::Content::TupleContent).getIndex() = 1
5148
or
52-
// flow out from array elements of at the sink,
49+
// flow out from array elements (and other collection content) at the sink,
5350
// for example in `database.allStatements(sql: "", arguments: [sensitive])`.
5451
isSink(node) and
5552
c.getAReadContent() instanceof DataFlow::Content::CollectionContent

0 commit comments

Comments
 (0)