mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Merge pull request #18154 from geoffw0/swift6models4
Swift: Fix for OptionSet and BinaryInteger models
This commit is contained in:
@@ -12,7 +12,11 @@ private import codeql.swift.dataflow.FlowSteps
|
||||
*/
|
||||
private class RawRepresentableSummaries extends SummaryModelCsv {
|
||||
override predicate row(string row) {
|
||||
row = ";RawRepresentable;true;init(rawValue:);;;Argument[0];ReturnValue;taint"
|
||||
row =
|
||||
[
|
||||
";RawRepresentable;true;init(rawValue:);;;Argument[0];ReturnValue;taint",
|
||||
";OptionSet;true;init(rawValue:);;;Argument[0];ReturnValue;taint"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ private class StringFieldsInheritTaint extends TaintInheritingContent,
|
||||
"precomposedStringWithCompatibilityMapping", "removingPercentEncoding"
|
||||
]
|
||||
or
|
||||
namedTypeDecl.getFullName() = "CustomStringConvertible" and
|
||||
namedTypeDecl.getFullName() = ["CustomStringConvertible", "BinaryInteger"] and
|
||||
fieldDecl.getName() = "description"
|
||||
or
|
||||
namedTypeDecl.getFullName() = "CustomDebugStringConvertible" and
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
testFailures
|
||||
| optionset.swift:60:49:61:1 | // $ tainted=60\n | Missing result: tainted=60 |
|
||||
| optionset.swift:65:58:66:1 | // $ tainted=65\n | Missing result: tainted=65 |
|
||||
| string.swift:599:35:600:1 | // $ tainted=599\n | Missing result: tainted=599 |
|
||||
failures
|
||||
|
||||
Reference in New Issue
Block a user