Skip to content

Commit 065ca3c

Browse files
authored
Update DivideByZeroUsingReturnValue.ql
1 parent a2836dc commit 065ca3c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-369/DivideByZeroUsingReturnValue.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ predicate mayBeReturnZero(Function fn) {
6262
}
6363

6464
/** Gets the Guard which compares the expression `bound` */
65+
pragma[inline]
6566
GuardCondition checkByValue(Expr bound, Expr val) {
6667
exists(GuardCondition gc |
6768
(
@@ -122,8 +123,8 @@ pragma[inline]
122123
predicate checkConditions1(Expr div, Function fn, float changeInt) {
123124
exists(Expr val |
124125
(
125-
val.getEnclosingFunction() = fn or
126-
val.getEnclosingFunction() = div.getEnclosingFunction()
126+
val.getEnclosingFunction() = fn //or
127+
//val.getEnclosingFunction() = div.getEnclosingFunction()
127128
) and
128129
val.getValue().toFloat() = changeInt and
129130
compareFunctionWithValue(div, fn, val)

0 commit comments

Comments
 (0)