@@ -24,7 +24,6 @@ struct Locale {
24
24
25
25
26
26
27
-
28
27
29
28
enum CInterop {
30
29
typealias Char = CChar
@@ -104,6 +103,7 @@ extension StringProtocol {
104
103
func substring( from index: Self . Index ) -> String { return " " }
105
104
func trimmingCharacters( in set: CharacterSet ) -> String { return " " }
106
105
func appending< T> ( _ aString: T ) -> String where T : StringProtocol { return " " }
106
+ func appendingFormat< T> ( _ format: T , _ arguments: CVarArg ... ) -> String where T : StringProtocol { return " " }
107
107
func padding< T> ( toLength newLength: Int , withPad padString: T , startingAt padIndex: Int ) -> String where T: StringProtocol { return " " }
108
108
func components( separatedBy separator: CharacterSet ) -> [ String ] { return [ ] }
109
109
func folding( options: String . CompareOptions = [ ] , locale: Locale ? ) -> String { return " " }
@@ -648,3 +648,17 @@ func furtherTaintThroughCallbacks() {
648
648
let result6 = try ? tainted. withContiguousStorageIfAvailable ( callbackWithTaintedPointer)
649
649
sink ( arg: result6!) // $ tainted=612
650
650
}
651
+
652
+ func testAppendingFormat( ) {
653
+ var s1 = source2 ( )
654
+ sink ( arg: s1. appendingFormat ( " %s %i " , " " , 0 ) ) // $ tainted=653
655
+
656
+ var s2 = " "
657
+ sink ( arg: s2. appendingFormat ( source2 ( ) , " " , 0 ) ) // $ tainted=657
658
+
659
+ var s3 = " "
660
+ sink ( arg: s3. appendingFormat ( " %s %i " , source2 ( ) , 0 ) ) // $ MISSING: tainted=660
661
+
662
+ var s4 = " "
663
+ sink ( arg: s4. appendingFormat ( " %s %i " , " " , source ( ) ) ) // $ MISSING: tainted=663
664
+ }
0 commit comments