File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
cpp/ql/lib/semmle/code/cpp/models/implementations Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,12 @@ private class StdSetConstructor extends Constructor, TaintFunction {
27
27
28
28
override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
29
29
// taint flow from any parameter of an iterator type to the qualifier
30
- input .isParameterDeref ( this .getAnIteratorParameterIndex ( ) ) and
30
+ (
31
+ // AST dataflow doesn't have indirection for iterators.
32
+ // Once we deprecate AST dataflow we can delete this first disjunct.
33
+ input .isParameter ( this .getAnIteratorParameterIndex ( ) ) or
34
+ input .isParameterDeref ( this .getAnIteratorParameterIndex ( ) )
35
+ ) and
31
36
(
32
37
output .isReturnValue ( ) // TODO: this is only needed for AST data flow, which treats constructors as returning the new object
33
38
or
@@ -45,7 +50,12 @@ private class StdSetInsert extends TaintFunction {
45
50
override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
46
51
// flow from last parameter to qualifier and return value
47
52
// (where the return value is a pair, this should really flow just to the first part of it)
48
- input .isParameterDeref ( this .getNumberOfParameters ( ) - 1 ) and
53
+ (
54
+ // AST dataflow doesn't have indirection for iterators.
55
+ // Once we deprecate AST dataflow we can delete this first disjunct.
56
+ input .isParameter ( this .getNumberOfParameters ( ) - 1 ) or
57
+ input .isParameterDeref ( this .getNumberOfParameters ( ) - 1 )
58
+ ) and
49
59
(
50
60
output .isQualifierObject ( ) or
51
61
output .isReturnValue ( )
You can’t perform that action at this time.
0 commit comments