Skip to content

Commit 336548f

Browse files
committed
Swift: Improve comments.
1 parent 9474e63 commit 336548f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

swift/ql/src/queries/Security/CWE-135/StringLengthConflation.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class StringLengthConflationConfiguration extends DataFlow::Configuration {
8686
call.getStaticTarget() = funcDecl and
8787
flowstate = "String" // `String` length flowing into `NSString`
8888
or
89-
// arguments to function calls...
89+
// arguments to method calls...
9090
(
9191
// `String.dropFirst`, `String.dropLast`, `String.removeFirst`, `String.removeLast`
9292
funcName = ["dropFirst(_:)", "dropLast(_:)", "removeFirst(_:)", "removeLast(_:)"] and
@@ -111,6 +111,7 @@ class StringLengthConflationConfiguration extends DataFlow::Configuration {
111111
call.getFunction().(ApplyExpr).getStaticTarget() = funcDecl and
112112
flowstate = "NSString" // `NSString` length flowing into `String`
113113
) and
114+
// match up `funcName`, `paramName`, `arg`, `node`.
114115
funcDecl.getName() = funcName and
115116
funcDecl.getParam(pragma[only_bind_into](arg)).getName() = paramName and
116117
call.getArgument(pragma[only_bind_into](arg)).getExpr() = node.asExpr()

0 commit comments

Comments
 (0)