C++: Also check the number of parameters to keep the tests happy.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-06-01 10:17:57 +02:00
parent 615c805b2c
commit 8765c33847

View File

@@ -19,7 +19,11 @@ import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis
import TaintedWithPath
predicate isUnboundedRandCall(FunctionCall fc) {
fc.getTarget().hasGlobalOrStdOrBslName("rand") and not bounded(fc)
exists(Function func | func = fc.getTarget() |
func.hasGlobalOrStdOrBslName("rand") and
not bounded(fc) and
func.getNumberOfParameters() = 0
)
}
/**