Skip to content

Commit 19026e9

Browse files
committed
Swift: Work around toString change.
1 parent da7f491 commit 19026e9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ predicate isSink0(Expr e) {
7171
// `NSMakeRange`
7272
funcName = "NSMakeRange" and
7373
argName = ["loc", "len"] and
74-
call.getStaticTarget().getName() = funcName and
74+
call.getStaticTarget().getName().matches(funcName + "%") and
7575
call.getStaticTarget().getParam(arg).getName() = argName and
7676
call.getArgument(arg).getExpr() = e
7777
)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
edges
22
nodes
3+
| StringLengthConflation.swift:72:33:72:35 | .count | semmle.label | .count |
34
| StringLengthConflation.swift:78:47:78:49 | .count | semmle.label | .count |
45
subpaths
56
#select
7+
| StringLengthConflation.swift:72:33:72:35 | .count | StringLengthConflation.swift:72:33:72:35 | .count | StringLengthConflation.swift:72:33:72:35 | .count | RESULT |
68
| StringLengthConflation.swift:78:47:78:49 | .count | StringLengthConflation.swift:78:47:78:49 | .count | StringLengthConflation.swift:78:47:78:49 | .count | RESULT |

0 commit comments

Comments
 (0)