We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41c93d9 commit 615c805Copy full SHA for 615c805
cpp/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql
@@ -18,16 +18,8 @@ import semmle.code.cpp.security.TaintTracking
18
import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis
19
import TaintedWithPath
20
21
-string getAMinPattern() { result = ["%min%", "l%"] }
22
-
23
-string getAMaxPattern() { result = ["%max%", "%bound%", "h%"] }
24
25
predicate isUnboundedRandCall(FunctionCall fc) {
26
- exists(Function func | func = fc.getTarget() |
27
- func.getName() = "rand" and
28
- not bounded(fc) and
29
- not func.getAParameter().getName().toLowerCase().matches([getAMinPattern(), getAMaxPattern()])
30
- )
+ fc.getTarget().hasGlobalOrStdOrBslName("rand") and not bounded(fc)
31
}
32
33
/**
0 commit comments