Skip to content

Commit 5509562

Browse files
committed
C++: Repair a few broken models that were incorrectly a pointer
as tainted (instead of the pointee), or vice versa. Because of existing dataflow pointer/pointee conflation we never noticed that, but since this PR removes those imprecisions we now need to update these models.
1 parent 6d313ac commit 5509562

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

cpp/ql/lib/semmle/code/cpp/models/implementations/Iterator.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private class IteratorCrementMemberOperator extends MemberFunction, DataFlowFunc
223223
output.isQualifierObject()
224224
or
225225
input.isQualifierObject() and
226-
output.isReturnValueDeref()
226+
output.isReturnValue()
227227
}
228228

229229
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {

cpp/ql/lib/semmle/code/cpp/models/implementations/StdContainer.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private class StdSequenceContainerInsert extends TaintFunction {
176176
) and
177177
(
178178
output.isQualifierObject() or
179-
output.isReturnValueDeref()
179+
output.isReturnValue()
180180
)
181181
}
182182
}

cpp/ql/lib/semmle/code/cpp/models/implementations/StdString.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private class StdStringAppend extends TaintFunction {
176176
) and
177177
(
178178
output.isQualifierObject() or
179-
output.isReturnValueDeref()
179+
output.isReturnValue()
180180
)
181181
or
182182
// reverse flow from returned reference to the qualifier (for writes to
@@ -543,11 +543,11 @@ private class StdOStreamOutNonMember extends DataFlowFunction, TaintFunction {
543543

544544
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
545545
// flow from second parameter to first parameter
546-
input.isParameter(1) and
546+
input.isParameterDeref(1) and
547547
output.isParameterDeref(0)
548548
or
549549
// flow from second parameter to return value
550-
input.isParameter(1) and
550+
input.isParameterDeref(1) and
551551
output.isReturnValueDeref()
552552
or
553553
// reverse flow from returned reference to the first parameter

cpp/ql/lib/semmle/code/cpp/models/implementations/Strcat.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class StrcatFunction extends TaintFunction, DataFlowFunction, ArrayFunction, Sid
6161
input.isParameterDeref(0) and
6262
output.isParameterDeref(0)
6363
or
64-
input.isParameter(1) and
64+
input.isParameterDeref(1) and
6565
output.isParameterDeref(0)
6666
}
6767

0 commit comments

Comments
 (0)