@@ -72,10 +72,8 @@ private class RandS extends RandomFunction {
7272 override FunctionOutput getFunctionOutput ( ) { result .isParameterDeref ( 0 ) }
7373}
7474
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 ) )
7977}
8078
8179class UncontrolledArithConfiguration extends TaintTracking:: Configuration {
@@ -93,7 +91,7 @@ class UncontrolledArithConfiguration extends TaintTracking::Configuration {
9391 )
9492 }
9593
96- override predicate isSink ( DataFlow:: Node sink ) { missingGuard ( sink .asExpr ( ) , _ ) }
94+ override predicate isSink ( DataFlow:: Node sink ) { missingGuard ( sink .asExpr ( ) ) }
9795
9896 override predicate isSanitizer ( DataFlow:: Node node ) {
9997 bounded ( node .asExpr ( ) )
@@ -117,11 +115,11 @@ Expr getExpr(DataFlow::Node node) { result = [node.asExpr(), node.asDefiningArgu
117115
118116from
119117 UncontrolledArithConfiguration config , DataFlow:: PathNode source , DataFlow:: PathNode sink ,
120- VariableAccess va , string effect
118+ VariableAccess va
121119where
122120 config .hasFlowPath ( source , sink ) and
123121 sink .getNode ( ) .asExpr ( ) = va and
124- missingGuard ( va , effect )
122+ missingGuard ( va )
125123select 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 ." ,
127125 getExpr ( source .getNode ( ) ) , "Uncontrolled value"
0 commit comments