Skip to content

Commit dbb0333

Browse files
committed
Swift: Add a test case confirming a model works outside of closures.
1 parent 507cf11 commit dbb0333

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ func taintThroughURL() {
260260
if let x = URL(string: clean) {
261261
sink(arg: x)
262262
}
263-
264263
if let y = URL(string: tainted) {
265264
sink(arg: y) // $ tainted=210
266265
}
@@ -289,7 +288,8 @@ func taintThroughURL() {
289288
ptrClean in
290289
sink(arg: URL(fileURLWithFileSystemRepresentation: ptrClean, isDirectory: false, relativeTo: nil))
291290
sink(arg: URL(fileURLWithFileSystemRepresentation: ptrClean, isDirectory: false, relativeTo: urlTainted)) // $ MISSING: tainted=210
292-
})
291+
});
292+
sink(arg: URL(fileURLWithFileSystemRepresentation: 0 as! UnsafePointer<Int8>, isDirectory: false, relativeTo: urlTainted)) // $ tainted=210
293293
let _ = tainted.withCString({
294294
ptrTainted in
295295
sink(arg: URL(fileURLWithFileSystemRepresentation: ptrTainted, isDirectory: false, relativeTo: nil)) // $ MISSING: tainted=210

0 commit comments

Comments
 (0)