@@ -113,7 +113,6 @@ private class StringSummaries extends SummaryModelCsv {
113
113
";String;true;localizedStringWithFormat(_:_:);;;Argument[0];ReturnValue;taint" ,
114
114
";String;true;localizedStringWithFormat(_:_:);;;Argument[1].CollectionElement;ReturnValue;taint" ,
115
115
";String;true;insert(contentsOf:at:);;;Argument[0];Argument[-1];taint" ,
116
- ";String;true;replaceSubrange(_:with:);;;Argument[1];Argument[-1];taint" ,
117
116
";String;true;max();;;Argument[-1];ReturnValue;taint" ,
118
117
";String;true;max(by:);;;Argument[-1];ReturnValue;taint" ,
119
118
";String;true;min();;;Argument[-1];ReturnValue;taint" ,
@@ -127,6 +126,9 @@ private class StringSummaries extends SummaryModelCsv {
127
126
";String;true;decodeCString(_:as:repairingInvalidCodeUnits:);;;Argument[0];ReturnValue.TupleElement[0];taint" ,
128
127
";String;true;decodeCString(_:as:repairingInvalidCodeUnits:);;;Argument[0].CollectionElement;ReturnValue.TupleElement[0];taint" ,
129
128
";LosslessStringConvertible;true;init(_:);;;Argument[0];ReturnValue;taint" ,
129
+ ";Substring;true;withUTF8(_:);;;Argument[-1];Argument[0].Parameter[0].CollectionElement;taint" ,
130
+ ";Substring;true;withUTF8(_:);;;Argument[0].Parameter[0].CollectionElement;Argument[-1];taint" ,
131
+ ";Substring;true;withUTF8(_:);;;Argument[0].ReturnValue;ReturnValue;value" ,
130
132
]
131
133
}
132
134
}
@@ -139,23 +141,26 @@ private class StringFieldsInheritTaint extends TaintInheritingContent,
139
141
DataFlow:: Content:: FieldContent
140
142
{
141
143
StringFieldsInheritTaint ( ) {
142
- this .getField ( )
143
- .hasQualifiedName ( [ "String" , "StringProtocol" ] ,
144
+ exists ( FieldDecl fieldDecl , Decl declaringDecl , TypeDecl namedTypeDecl |
145
+ (
146
+ namedTypeDecl .getFullName ( ) = [ "String" , "StringProtocol" ] and
147
+ fieldDecl .getName ( ) =
144
148
[
145
149
"unicodeScalars" , "utf8" , "utf16" , "lazy" , "utf8CString" , "dataValue" ,
146
150
"identifierValue" , "capitalized" , "localizedCapitalized" , "localizedLowercase" ,
147
151
"localizedUppercase" , "decomposedStringWithCanonicalMapping" ,
148
152
"decomposedStringWithCompatibilityMapping" , "precomposedStringWithCanonicalMapping" ,
149
153
"precomposedStringWithCompatibilityMapping" , "removingPercentEncoding"
150
- ] )
151
- or
152
- exists ( FieldDecl fieldDecl , Decl declaringDecl , TypeDecl namedTypeDecl |
153
- (
154
+ ]
155
+ or
154
156
namedTypeDecl .getFullName ( ) = "CustomStringConvertible" and
155
157
fieldDecl .getName ( ) = "description"
156
158
or
157
159
namedTypeDecl .getFullName ( ) = "CustomDebugStringConvertible" and
158
160
fieldDecl .getName ( ) = "debugDescription"
161
+ or
162
+ namedTypeDecl .getFullName ( ) = "Substring" and
163
+ fieldDecl .getName ( ) = "base"
159
164
) and
160
165
declaringDecl .getAMember ( ) = fieldDecl and
161
166
declaringDecl .asNominalTypeDecl ( ) = namedTypeDecl .getADerivedTypeDecl * ( ) and
0 commit comments