Skip to content

Commit 4380495

Browse files
committed
Swift: Model Sequence.withContiguousSrtorageIfAvailable.
1 parent 56b6441 commit 4380495

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

swift/ql/lib/codeql/swift/frameworks/StandardLibrary/Sequence.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ private class SequenceSummaries extends SummaryModelCsv {
2525
";Sequence;true;joined();;;Argument[-1];ReturnValue;taint",
2626
";Sequence;true;joined(separator:);;;Argument[-1..0];ReturnValue;taint",
2727
";Sequence;true;first(where:);;;Argument[-1];ReturnValue;taint",
28+
";Sequence;true;withContiguousStorageIfAvailable(_:);;;Argument[-1];Argument[0].Parameter[0];taint",
2829
]
2930
}
3031
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,12 @@ func taintThroughEncodings() {
433433

434434
clean.withContiguousStorageIfAvailable({
435435
ptr in
436-
sink(arg: ptr)
436+
sink(arg: ptr) // $ SPURIOUS: tainted=366
437437
sink(arg: ptr.baseAddress!)
438438
})
439439
tainted.withContiguousStorageIfAvailable({
440440
ptr in
441-
sink(arg: ptr)
441+
sink(arg: ptr) // $ tainted=366
442442
sink(arg: ptr.baseAddress!) // $ MISSING: tainted=366
443443
})
444444
}

0 commit comments

Comments
 (0)