Skip to content

Commit d13170d

Browse files
committed
Swift: Model return values.
1 parent 52e84ba commit d13170d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ 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"
28+
";Sequence;true;withContiguousStorageIfAvailable(_:);;;Argument[-1];Argument[0].Parameter[0];taint",
29+
";Sequence;true;withContiguousStorageIfAvailable(_:);;;Argument[0].ReturnValue;ReturnValue;taint",
2930
]
3031
}
3132
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ func furtherTaintThroughCallbacks() {
626626
ptr in
627627
return source()
628628
})
629-
sink(arg: result2!) // $ MISSING: tainted=627
629+
sink(arg: result2!) // $ tainted=627
630630

631631
// return values from the closure (2)
632632
if let result3 = clean.withContiguousStorageIfAvailable({
@@ -646,5 +646,5 @@ func furtherTaintThroughCallbacks() {
646646
let result5 = try? clean.withContiguousStorageIfAvailable(callbackWithCleanPointer)
647647
sink(arg: result5!)
648648
let result6 = try? tainted.withContiguousStorageIfAvailable(callbackWithTaintedPointer)
649-
sink(arg: result6!) // $ MISSING: tainted=612
649+
sink(arg: result6!) // $ tainted=612
650650
}

0 commit comments

Comments
 (0)