File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
cpp/ql/src/semmle/code/cpp/models/implementations Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11import semmle.code.cpp.models.interfaces.Taint
22
3+ /**
4+ * The `std::shared_ptr` and `std::unique_ptr` template classes.
5+ */
36class UniqueOrSharedPtr extends Class {
47 UniqueOrSharedPtr ( ) { this .hasQualifiedName ( "std" , [ "shared_ptr" , "unique_ptr" ] ) }
58}
69
10+ /**
11+ * The `std::make_shared` and `std::make_unique` template functions.
12+ */
713class MakeUniqueOrShared extends TaintFunction {
814 MakeUniqueOrShared ( ) { this .hasQualifiedName ( "std" , [ "make_shared" , "make_unique" ] ) }
915
1016 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
11- // Exclude the `template<class T> shared_ptr<T[]> make_shared( std::size_t)` specialization
12- // since we don't want to propagate taint via the size of the allocation .
17+ // Exclude the specializations of `std:: make_shared` and ` std::make_unique` that allocate arrays
18+ // since these just take a size argument, which we don't want to propagate taint through .
1319 not this .isArray ( ) and
1420 input .isParameter ( _) and
1521 output .isReturnValue ( )
You can’t perform that action at this time.
0 commit comments