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) {
211
211
arg .getExpr ( ) instanceof InOutExpr
212
212
or
213
213
arg .getExpr ( ) .getType ( ) instanceof NominalType
214
+ or
215
+ arg .getLabel ( ) = "ptr"
214
216
}
215
217
216
218
predicate modifiableParam ( ParamDecl param ) {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ func taintPointer(ptr: UnsafeMutablePointer<String>) {
25
25
}
26
26
27
27
func clearPointer2( ptr: UnsafeMutablePointer < String > ) {
28
- sink ( arg: ptr. pointee) // $ MISSING: tainted=21
28
+ sink ( arg: ptr. pointee) // $ tainted=21
29
29
sink ( arg: ptr)
30
30
31
31
ptr. pointee = " abc "
@@ -42,12 +42,12 @@ func testMutatingPointerInCall(ptr: UnsafeMutablePointer<String>) {
42
42
43
43
taintPointer ( ptr: ptr) // mutates `ptr` pointee with a tainted value
44
44
45
- sink ( arg: ptr. pointee) // $ MISSING: tainted=21
45
+ sink ( arg: ptr. pointee) // $ tainted=21
46
46
sink ( arg: ptr)
47
47
48
48
clearPointer2 ( ptr: ptr)
49
49
50
- sink ( arg: ptr. pointee)
50
+ sink ( arg: ptr. pointee) // $ SPURIOUS: tainted=21
51
51
sink ( arg: ptr)
52
52
}
53
53
@@ -96,6 +96,6 @@ func testMutatingMyPointerInCall(ptr: MyPointer) {
96
96
97
97
taintMyPointer ( ptr: ptr) // mutates `ptr` pointee with a tainted value
98
98
99
- sink ( arg: ptr. pointee) // $ MISSING: tainted=87
99
+ sink ( arg: ptr. pointee) // $ tainted=87
100
100
sink ( arg: ptr)
101
101
}
You can’t perform that action at this time.
0 commit comments