@@ -72,10 +72,8 @@ private class RandS extends RandomFunction {
72
72
override FunctionOutput getFunctionOutput ( ) { result .isParameterDeref ( 0 ) }
73
73
}
74
74
75
- predicate missingGuard ( VariableAccess va , string effect ) {
76
- exists ( Operation op | op .getAnOperand ( ) = va |
77
- missingGuardAgainstOverflow ( op , va ) and effect = "overflow"
78
- )
75
+ predicate missingGuard ( VariableAccess va ) {
76
+ exists ( Operation op | op .getAnOperand ( ) = va | missingGuardAgainstOverflow ( op , va ) )
79
77
}
80
78
81
79
class UncontrolledArithConfiguration extends TaintTracking:: Configuration {
@@ -93,7 +91,7 @@ class UncontrolledArithConfiguration extends TaintTracking::Configuration {
93
91
)
94
92
}
95
93
96
- override predicate isSink ( DataFlow:: Node sink ) { missingGuard ( sink .asExpr ( ) , _ ) }
94
+ override predicate isSink ( DataFlow:: Node sink ) { missingGuard ( sink .asExpr ( ) ) }
97
95
98
96
override predicate isSanitizer ( DataFlow:: Node node ) {
99
97
bounded ( node .asExpr ( ) )
@@ -117,11 +115,11 @@ Expr getExpr(DataFlow::Node node) { result = [node.asExpr(), node.asDefiningArgu
117
115
118
116
from
119
117
UncontrolledArithConfiguration config , DataFlow:: PathNode source , DataFlow:: PathNode sink ,
120
- VariableAccess va , string effect
118
+ VariableAccess va
121
119
where
122
120
config .hasFlowPath ( source , sink ) and
123
121
sink .getNode ( ) .asExpr ( ) = va and
124
- missingGuard ( va , effect )
122
+ missingGuard ( va )
125
123
select sink .getNode ( ) , source , sink ,
126
- "$@ flows to here and is used in arithmetic, potentially causing an " + effect + " .",
124
+ "$@ flows to here and is used in arithmetic, potentially causing an overflow ." ,
127
125
getExpr ( source .getNode ( ) ) , "Uncontrolled value"
0 commit comments