Skip to content

Commit 9aaf306

Browse files
authored
Merge pull request github#12307 from geoffw0/stringconflationtaint
Swift: Update swift/string-length-conflation to taint tracking
2 parents d4e02eb + cb8f597 commit 9aaf306

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import swift
1414
import codeql.swift.dataflow.DataFlow
15+
import codeql.swift.dataflow.TaintTracking
1516
import DataFlow::PathGraph
1617

1718
/**
@@ -52,7 +53,7 @@ class StringLengthConflationFlowState extends string {
5253
* a `String` or an `NSString` object, to a sink of a different kind that
5354
* expects an incompatible measure of length.
5455
*/
55-
class StringLengthConflationConfiguration extends DataFlow::Configuration {
56+
class StringLengthConflationConfiguration extends TaintTracking::Configuration {
5657
StringLengthConflationConfiguration() { this = "StringLengthConflationConfiguration" }
5758

5859
override predicate isSource(DataFlow::Node node, string flowstate) {
@@ -177,11 +178,6 @@ class StringLengthConflationConfiguration extends DataFlow::Configuration {
177178
correctFlowState.(StringLengthConflationFlowState).getEquivClass()
178179
)
179180
}
180-
181-
override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
182-
// allow flow through `+`, `-`, `*` etc.
183-
node2.asExpr().(ArithmeticOperation).getAnOperand() = node1.asExpr()
184-
}
185181
}
186182

187183
from

0 commit comments

Comments
 (0)