File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
docs/codeql/codeql-language-guides Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -140,13 +140,13 @@ The following example finds calls to ``String.init(format:_:)`` where the format
140
140
import swift
141
141
import codeql.swift.dataflow.DataFlow
142
142
143
- from CallExpr call, Method method, Expr sinkExpr
143
+ from CallExpr call, Method method, DataFlow::Node sinkNode
144
144
where
145
145
call.getStaticTarget() = method and
146
146
method.hasQualifiedName("String", "init(format:_:)") and
147
- sinkExpr = call.getArgument(0).getExpr() and
147
+ sinkNode.asExpr() = call.getArgument(0).getExpr() and
148
148
not exists(StringLiteralExpr sourceLiteral |
149
- DataFlow::localFlow(DataFlow::exprNode(sourceLiteral), DataFlow::exprNode(sinkExpr) )
149
+ DataFlow::localFlow(DataFlow::exprNode(sourceLiteral), sinkNode )
150
150
)
151
151
select call, "Format argument to " + method.getName() + " isn't hard-coded."
152
152
You can’t perform that action at this time.
0 commit comments