File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
lib/semmle/code/cpp/models Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ private class PostgreSqlExecutionFunction extends SqlExecutionFunction {
71
71
}
72
72
}
73
73
74
- private class PostgreSqlEscapeFunction extends SqlEscapeFunction {
75
- PostgreSqlEscapeFunction ( ) {
74
+ private class PostgreSqlBarrierFunction extends SqlBarrierFunction {
75
+ PostgreSqlBarrierFunction ( ) {
76
76
exists ( Class c |
77
77
this .getDeclaringType ( ) = c and
78
78
// transaction and connection escape functions
@@ -84,7 +84,7 @@ private class PostgreSqlEscapeFunction extends SqlEscapeFunction {
84
84
)
85
85
}
86
86
87
- override predicate escapesSqlArgument ( FunctionInput input , FunctionOutput output ) {
87
+ override predicate barrierSqlArgument ( FunctionInput input , FunctionOutput output ) {
88
88
exists ( int argIndex |
89
89
input .isParameterDeref ( argIndex ) and
90
90
output .isReturnValueDeref ( ) and
Original file line number Diff line number Diff line change 1
1
/**
2
2
* Provides abstract classes for modeling functions that execute and escape SQL query strings.
3
- * To use this QL library, create a QL class extending `SqlExecutionFunction` or `SqlEscapeFunction`
3
+ * To extend this QL library, create a QL class extending `SqlExecutionFunction` or `SqlEscapeFunction`
4
4
* with a characteristic predicate that selects the function or set of functions you are modeling.
5
5
* Within that class, override the predicates provided by the class to match the way a
6
6
* parameter flows into the function and, in the case of `SqlEscapeFunction`, out of the function.
@@ -21,10 +21,10 @@ abstract class SqlExecutionFunction extends Function {
21
21
/**
22
22
* An abstract class that represents a function that escapes an SQL query string.
23
23
*/
24
- abstract class SqlEscapeFunction extends Function {
24
+ abstract class SqlBarrierFunction extends Function {
25
25
/**
26
- * Holds if the `output` escapes the SQL input `input` such that is it safe to pass to
26
+ * Holds if the `output` is a barrier to the SQL input `input` such that is it safe to pass to
27
27
* an `SqlExecutionFunction`.
28
28
*/
29
- abstract predicate escapesSqlArgument ( FunctionInput input , FunctionOutput output ) ;
29
+ abstract predicate barrierSqlArgument ( FunctionInput input , FunctionOutput output ) ;
30
30
}
Original file line number Diff line number Diff line change @@ -34,10 +34,10 @@ class Configuration extends TaintTrackingConfiguration {
34
34
or
35
35
e .getUnspecifiedType ( ) instanceof IntegralType
36
36
or
37
- exists ( SqlEscapeFunction sql , int arg , FunctionInput input |
37
+ exists ( SqlBarrierFunction sql , int arg , FunctionInput input |
38
38
e = sql .getACallToThisFunction ( ) .getArgument ( arg ) and
39
39
input .isParameterDeref ( arg ) and
40
- sql .escapesSqlArgument ( input , _)
40
+ sql .barrierSqlArgument ( input , _)
41
41
)
42
42
}
43
43
}
You can’t perform that action at this time.
0 commit comments