File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
lib/codeql/swift/dataflow/internal
test/library-tests/dataflow/taint/libraries Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,8 @@ private predicate modifiable(Argument arg) {
211211 arg .getExpr ( ) instanceof InOutExpr
212212 or
213213 arg .getExpr ( ) .getType ( ) instanceof NominalType
214+ or
215+ arg .getLabel ( ) = "ptr"
214216}
215217
216218predicate modifiableParam ( ParamDecl param ) {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ func taintPointer(ptr: UnsafeMutablePointer<String>) {
2525}
2626
2727func clearPointer2( ptr: UnsafeMutablePointer < String > ) {
28- sink ( arg: ptr. pointee) // $ MISSING: tainted=21
28+ sink ( arg: ptr. pointee) // $ tainted=21
2929 sink ( arg: ptr)
3030
3131 ptr. pointee = " abc "
@@ -42,12 +42,12 @@ func testMutatingPointerInCall(ptr: UnsafeMutablePointer<String>) {
4242
4343 taintPointer ( ptr: ptr) // mutates `ptr` pointee with a tainted value
4444
45- sink ( arg: ptr. pointee) // $ MISSING: tainted=21
45+ sink ( arg: ptr. pointee) // $ tainted=21
4646 sink ( arg: ptr)
4747
4848 clearPointer2 ( ptr: ptr)
4949
50- sink ( arg: ptr. pointee)
50+ sink ( arg: ptr. pointee) // $ SPURIOUS: tainted=21
5151 sink ( arg: ptr)
5252}
5353
@@ -96,6 +96,6 @@ func testMutatingMyPointerInCall(ptr: MyPointer) {
9696
9797 taintMyPointer ( ptr: ptr) // mutates `ptr` pointee with a tainted value
9898
99- sink ( arg: ptr. pointee) // $ MISSING: tainted=87
99+ sink ( arg: ptr. pointee) // $ tainted=87
100100 sink ( arg: ptr)
101101}
You can’t perform that action at this time.
0 commit comments