@@ -14,10 +14,7 @@ import semmle.code.cpp.models.interfaces.Taint
1414 */
1515class StdSequenceContainerConstructor extends Constructor , TaintFunction {
1616 StdSequenceContainerConstructor ( ) {
17- this .getDeclaringType ( ) .hasQualifiedName ( "std" , "vector" ) or
18- this .getDeclaringType ( ) .hasQualifiedName ( "std" , "deque" ) or
19- this .getDeclaringType ( ) .hasQualifiedName ( "std" , "list" ) or
20- this .getDeclaringType ( ) .hasQualifiedName ( "std" , "forward_list" )
17+ this .getDeclaringType ( ) .hasQualifiedName ( "std" , [ "vector" , "deque" , "list" , "forward_list" ] )
2118 }
2219
2320 /**
@@ -42,10 +39,8 @@ class StdSequenceContainerConstructor extends Constructor, TaintFunction {
4239class StdSequenceContainerPush extends TaintFunction {
4340 StdSequenceContainerPush ( ) {
4441 this .hasQualifiedName ( "std" , "vector" , "push_back" ) or
45- this .hasQualifiedName ( "std" , "deque" , "push_back" ) or
46- this .hasQualifiedName ( "std" , "deque" , "push_front" ) or
47- this .hasQualifiedName ( "std" , "list" , "push_back" ) or
48- this .hasQualifiedName ( "std" , "list" , "push_front" ) or
42+ this .hasQualifiedName ( "std" , "deque" , [ "push_back" , "push_front" ] ) or
43+ this .hasQualifiedName ( "std" , "list" , [ "push_back" , "push_front" ] ) or
4944 this .hasQualifiedName ( "std" , "forward_list" , "push_front" )
5045 }
5146
@@ -61,14 +56,10 @@ class StdSequenceContainerPush extends TaintFunction {
6156 */
6257class StdSequenceContainerFrontBack extends TaintFunction {
6358 StdSequenceContainerFrontBack ( ) {
64- this .hasQualifiedName ( "std" , "array" , "front" ) or
65- this .hasQualifiedName ( "std" , "array" , "back" ) or
66- this .hasQualifiedName ( "std" , "vector" , "front" ) or
67- this .hasQualifiedName ( "std" , "vector" , "back" ) or
68- this .hasQualifiedName ( "std" , "deque" , "front" ) or
69- this .hasQualifiedName ( "std" , "deque" , "back" ) or
70- this .hasQualifiedName ( "std" , "list" , "front" ) or
71- this .hasQualifiedName ( "std" , "list" , "back" ) or
59+ this .hasQualifiedName ( "std" , "array" , [ "front" , "back" ] ) or
60+ this .hasQualifiedName ( "std" , "vector" , [ "front" , "back" ] ) or
61+ this .hasQualifiedName ( "std" , "deque" , [ "front" , "back" ] ) or
62+ this .hasQualifiedName ( "std" , "list" , [ "front" , "back" ] ) or
7263 this .hasQualifiedName ( "std" , "forward_list" , "front" )
7364 }
7465
@@ -84,11 +75,7 @@ class StdSequenceContainerFrontBack extends TaintFunction {
8475 */
8576class StdSequenceContainerSwap extends TaintFunction {
8677 StdSequenceContainerSwap ( ) {
87- this .hasQualifiedName ( "std" , "array" , "swap" ) or
88- this .hasQualifiedName ( "std" , "vector" , "swap" ) or
89- this .hasQualifiedName ( "std" , "deque" , "swap" ) or
90- this .hasQualifiedName ( "std" , "list" , "swap" ) or
91- this .hasQualifiedName ( "std" , "forward_list" , "swap" )
78+ this .hasQualifiedName ( "std" , [ "array" , "vector" , "deque" , "list" , "forward_list" ] , "swap" )
9279 }
9380
9481 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
@@ -106,12 +93,7 @@ class StdSequenceContainerSwap extends TaintFunction {
10693 */
10794class StdSequenceContainerAt extends TaintFunction {
10895 StdSequenceContainerAt ( ) {
109- this .hasQualifiedName ( "std" , "vector" , "at" ) or
110- this .hasQualifiedName ( "std" , "vector" , "operator[]" ) or
111- this .hasQualifiedName ( "std" , "array" , "at" ) or
112- this .hasQualifiedName ( "std" , "array" , "operator[]" ) or
113- this .hasQualifiedName ( "std" , "deque" , "at" ) or
114- this .hasQualifiedName ( "std" , "deque" , "operator[]" )
96+ this .hasQualifiedName ( "std" , [ "vector" , "array" , "deque" ] , [ "at" , "operator[]" ] )
11597 }
11698
11799 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
0 commit comments