@@ -24,7 +24,6 @@ struct Locale {
2424
2525
2626
27-
2827
2928enum CInterop {
3029 typealias Char = CChar
@@ -104,6 +103,7 @@ extension StringProtocol {
104103 func substring( from index: Self . Index ) -> String { return " " }
105104 func trimmingCharacters( in set: CharacterSet ) -> String { return " " }
106105 func appending< T> ( _ aString: T ) -> String where T : StringProtocol { return " " }
106+ func appendingFormat< T> ( _ format: T , _ arguments: CVarArg ... ) -> String where T : StringProtocol { return " " }
107107 func padding< T> ( toLength newLength: Int , withPad padString: T , startingAt padIndex: Int ) -> String where T: StringProtocol { return " " }
108108 func components( separatedBy separator: CharacterSet ) -> [ String ] { return [ ] }
109109 func folding( options: String . CompareOptions = [ ] , locale: Locale ? ) -> String { return " " }
@@ -648,3 +648,17 @@ func furtherTaintThroughCallbacks() {
648648 let result6 = try ? tainted. withContiguousStorageIfAvailable ( callbackWithTaintedPointer)
649649 sink ( arg: result6!) // $ tainted=612
650650}
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