File tree Expand file tree Collapse file tree
src/semmle/code/cpp/models/implementations
test/library-tests/dataflow/taint-tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ class StdVectorEmplace extends TaintFunction {
193193 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
194194 // flow from any parameter except the position iterator to qualifier and return value
195195 // (here we assume taint flow from any constructor parameter to the constructed object)
196- input .isParameter ( [ 1 .. getNumberOfParameters ( ) - 1 ] ) and
196+ input .isParameterDeref ( [ 1 .. getNumberOfParameters ( ) - 1 ] ) and
197197 (
198198 output .isQualifierObject ( ) or
199199 output .isReturnValue ( )
@@ -210,7 +210,7 @@ class StdVectorEmplaceBack extends TaintFunction {
210210 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
211211 // flow from any parameter to qualifier
212212 // (here we assume taint flow from any constructor parameter to the constructed object)
213- input .isParameter ( [ 0 .. getNumberOfParameters ( ) - 1 ] ) and
213+ input .isParameterDeref ( [ 0 .. getNumberOfParameters ( ) - 1 ] ) and
214214 output .isQualifierObject ( )
215215 }
216216}
Original file line number Diff line number Diff line change @@ -491,8 +491,8 @@ void test_vector_emplace() {
491491 std::vector<int > v1 (10 ), v2 (10 );
492492
493493 v1.emplace_back (source ());
494- sink (v1); // $ ast MISSING: ir
494+ sink (v1); // $ ast, ir
495495
496496 v2.emplace (v2.begin (), source ());
497- sink (v2); // $ ast MISSING: ir
497+ sink (v2); // $ ast, ir
498498}
You can’t perform that action at this time.
0 commit comments