Skip to content

Commit c954324

Browse files
committed
Swift: Correct a test case (but preserve the original as well since it's interesting).
1 parent 6ccf47e commit c954324

File tree

1 file changed

+6
-4
lines changed
  • swift/ql/test/library-tests/dataflow/taint/libraries

1 file changed

+6
-4
lines changed

swift/ql/test/library-tests/dataflow/taint/libraries/int.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,25 +144,27 @@ func taintCollections(array: inout Array<Int>, contiguousArray: inout Contiguous
144144
sink(arg: array[0]) // $ tainted=142
145145
array.withContiguousStorageIfAvailable({
146146
buffer in
147+
sink(arg: buffer) // $ SPURIOUS: tainted=142
148+
sink(arg: buffer[0]) // $ tainted=142
147149
sink(arg: array)
148150
sink(arg: array[0]) // $ MISSING: tainted=142
149151
})
150152

151153
contiguousArray[0] = source2()
152154
sink(arg: contiguousArray)
153-
sink(arg: contiguousArray[0]) // $ MISSING: tainted=151
155+
sink(arg: contiguousArray[0]) // $ MISSING: tainted=153
154156
contiguousArray.withContiguousStorageIfAvailable({
155157
buffer in
156158
sink(arg: buffer)
157-
sink(arg: buffer[0]) // $ MISSING: tainted=151
159+
sink(arg: buffer[0]) // $ MISSING: tainted=153
158160
})
159161

160162
dictionary[0] = source2()
161163
sink(arg: dictionary)
162-
sink(arg: dictionary[0]!) // $ MISSING: tainted=160
164+
sink(arg: dictionary[0]!) // $ MISSING: tainted=162
163165
dictionary.withContiguousStorageIfAvailable({
164166
buffer in
165167
sink(arg: buffer)
166-
sink(arg: buffer[0]) // $ MISSING: tainted=160
168+
sink(arg: buffer[0]) // $ MISSING: tainted=162
167169
})
168170
}

0 commit comments

Comments
 (0)