@@ -54,18 +54,18 @@ predicate pqxxTransactionSqlArgument(string function, int arg) {
54
54
predicate pqxxConnectionSqlArgument ( string function , int arg ) { function = "prepare" and arg = 1 }
55
55
56
56
Expr getPqxxSqlArgument ( ) {
57
- exists ( FunctionCall fc , Expr e , int argIndex , Type t |
57
+ exists ( FunctionCall fc , Expr e , int argIndex , UserType t |
58
58
// examples: 'work' for 'work.exec(...)'; '->' for 'tx->exec()'.
59
59
e = fc .getQualifier ( ) and
60
60
// to find ConnectionHandle/TransationHandle and similar classes which override '->' operator behavior
61
61
// and return pointer to a connection/transation object
62
62
e .getType ( ) .refersTo ( t ) and
63
63
// transaction exec and connection prepare variations
64
64
(
65
- pqxxTransationClassNames ( t .getName ( ) , _ ) and
65
+ pqxxTransationClassNames ( t .getName ( ) , t . getNamespace ( ) . getName ( ) ) and
66
66
pqxxTransactionSqlArgument ( fc .getTarget ( ) .getName ( ) , argIndex )
67
67
or
68
- pqxxConnectionClassNames ( t .getName ( ) , _ ) and
68
+ pqxxConnectionClassNames ( t .getName ( ) , t . getNamespace ( ) . getName ( ) ) and
69
69
pqxxConnectionSqlArgument ( fc .getTarget ( ) .getName ( ) , argIndex )
70
70
) and
71
71
result = fc .getArgument ( argIndex )
@@ -78,14 +78,17 @@ predicate pqxxEscapeArgument(string function, int arg) {
78
78
}
79
79
80
80
predicate isEscapedPqxxArgument ( Expr argExpr ) {
81
- exists ( FunctionCall fc , Expr e , int argIndex , Type t |
81
+ exists ( FunctionCall fc , Expr e , int argIndex , UserType t |
82
82
// examples: 'work' for 'work.exec(...)'; '->' for 'tx->exec()'.
83
83
e = fc .getQualifier ( ) and
84
84
// to find ConnectionHandle/TransationHandle and similar classes which override '->' operator behavior
85
85
// and return pointer to a connection/transation object
86
86
e .getType ( ) .refersTo ( t ) and
87
87
// transaction and connection escape functions
88
- ( pqxxTransationClassNames ( t .getName ( ) , _) or pqxxConnectionClassNames ( t .getName ( ) , _) ) and
88
+ (
89
+ pqxxTransationClassNames ( t .getName ( ) , t .getNamespace ( ) .getName ( ) ) or
90
+ pqxxConnectionClassNames ( t .getName ( ) , t .getNamespace ( ) .getName ( ) )
91
+ ) and
89
92
pqxxEscapeArgument ( fc .getTarget ( ) .getName ( ) , argIndex ) and
90
93
// is escaped arg == argExpr
91
94
argExpr = fc .getArgument ( argIndex )
0 commit comments