mirror of
https://github.com/github/codeql.git
synced 2026-05-06 06:05:19 +02:00
Swift: Update similar cases.
This commit is contained in:
@@ -58,7 +58,7 @@ class StringLengthConflationConfiguration extends DataFlow::Configuration {
|
||||
override predicate isSource(DataFlow::Node node, string flowstate) {
|
||||
// result of a call to `String.count`
|
||||
exists(MemberRefExpr member |
|
||||
member.getBase().getType().getName() = "String" and
|
||||
member.getBase().getType().(NominalType).getABaseType*().getName() = "String" and
|
||||
member.getMember().(VarDecl).getName() = "count" and
|
||||
node.asExpr() = member and
|
||||
flowstate = "String"
|
||||
@@ -66,7 +66,8 @@ class StringLengthConflationConfiguration extends DataFlow::Configuration {
|
||||
or
|
||||
// result of a call to `NSString.length`
|
||||
exists(MemberRefExpr member |
|
||||
member.getBase().getType().getName() = ["NSString", "NSMutableString"] and
|
||||
member.getBase().getType().(NominalType).getABaseType*().getName() =
|
||||
["NSString", "NSMutableString"] and
|
||||
member.getMember().(VarDecl).getName() = "length" and
|
||||
node.asExpr() = member and
|
||||
flowstate = "NSString"
|
||||
@@ -74,7 +75,7 @@ class StringLengthConflationConfiguration extends DataFlow::Configuration {
|
||||
or
|
||||
// result of a call to `String.utf8.count`
|
||||
exists(MemberRefExpr member |
|
||||
member.getBase().getType().getName() = "String.UTF8View" and
|
||||
member.getBase().getType().(NominalType).getABaseType*().getName() = "String.UTF8View" and
|
||||
member.getMember().(VarDecl).getName() = "count" and
|
||||
node.asExpr() = member and
|
||||
flowstate = "String.utf8"
|
||||
@@ -82,7 +83,7 @@ class StringLengthConflationConfiguration extends DataFlow::Configuration {
|
||||
or
|
||||
// result of a call to `String.utf16.count`
|
||||
exists(MemberRefExpr member |
|
||||
member.getBase().getType().getName() = "String.UTF16View" and
|
||||
member.getBase().getType().(NominalType).getABaseType*().getName() = "String.UTF16View" and
|
||||
member.getMember().(VarDecl).getName() = "count" and
|
||||
node.asExpr() = member and
|
||||
flowstate = "String.utf16"
|
||||
@@ -90,7 +91,8 @@ class StringLengthConflationConfiguration extends DataFlow::Configuration {
|
||||
or
|
||||
// result of a call to `String.unicodeScalars.count`
|
||||
exists(MemberRefExpr member |
|
||||
member.getBase().getType().getName() = "String.UnicodeScalarView" and
|
||||
member.getBase().getType().(NominalType).getABaseType*().getName() =
|
||||
"String.UnicodeScalarView" and
|
||||
member.getMember().(VarDecl).getName() = "count" and
|
||||
node.asExpr() = member and
|
||||
flowstate = "String.unicodeScalars"
|
||||
|
||||
Reference in New Issue
Block a user