@@ -293,4 +293,52 @@ func taintThroughData() {
293
293
let pointerTainted44 = UnsafeMutableRawBufferPointer . allocate ( byteCount: 0 , alignment: 0 )
294
294
dataTainted44. copyBytes ( to: pointerTainted44)
295
295
sink ( arg: pointerTainted44) // $ tainted=292
296
+
297
+ let dataTainted45 = source ( ) as! Data
298
+ let result45 = dataTainted45. withContiguousStorageIfAvailable ( {
299
+ buffer in
300
+
301
+ sink ( arg: buffer) // $ tainted=297
302
+ sink ( arg: buffer [ 0 ] ) // $ tainted=297
303
+
304
+ return source ( ) as! Int
305
+ } )
306
+ sink ( arg: result45!) // $ tainted=304
307
+
308
+ var data46 = Data ( 0 )
309
+ let result46 = data46. withContiguousMutableStorageIfAvailable ( {
310
+ buffer in
311
+
312
+ buffer [ 0 ] = source ( ) as! UInt8
313
+ sink ( arg: buffer)
314
+ sink ( arg: buffer [ 0 ] ) // $ MISSING: tainted=312
315
+
316
+ return source ( ) as! Int
317
+ } )
318
+ sink ( arg: result46!) // $ tainted=316
319
+ sink ( arg: data46) // $ MISSING: tainted=312
320
+
321
+ let dataTainted47 = source ( ) as! Data
322
+ let result47 = dataTainted47. withUnsafeBytes ( {
323
+ buffer in
324
+
325
+ sink ( arg: buffer) // $ tainted=321
326
+ sink ( arg: buffer [ 0 ] ) // $ tainted=321
327
+
328
+ return source ( ) as! Int
329
+ } )
330
+ sink ( arg: result47) // $ tainted=328
331
+
332
+ var data48 = Data ( 0 )
333
+ let result48 = data48. withUnsafeMutableBytes ( {
334
+ buffer in
335
+
336
+ buffer [ 0 ] = source ( ) as! UInt8
337
+ sink ( arg: buffer)
338
+ sink ( arg: buffer [ 0 ] ) // $ MISSING: tainted=336
339
+
340
+ return source ( ) as! Int
341
+ } )
342
+ sink ( arg: result48) // $ tainted=340
343
+ sink ( arg: data48) // $ MISSING: tainted=336
296
344
}
0 commit comments