Skip to content

Commit 18bceaa

Browse files
committed
use explicitly converted in bounds
1 parent 6d7e2ea commit 18bceaa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/src/security/UnsafeImplicitConversions/UnsafeImplicitConversions.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ predicate safeLowerBound(Expr cast, IntegralType toType) {
187187
not exists(float knownValue | knownValue = cast.getValue().toFloat()) and
188188
instr.getUnconvertedResultExpression() = cast and
189189
boundedInstruction(instr, b, delta, false, _) and // false = lower bound
190-
lowerBound(b.getInstruction().getUnconvertedResultExpression()) + delta >=
190+
lowerBound(b.getInstruction().getUnconvertedResultExpression().getExplicitlyConverted()) + delta >=
191191
typeLowerBound(toType)
192192
)
193193
}
@@ -207,7 +207,7 @@ predicate safeUpperBound(Expr cast, IntegralType toType) {
207207
not exists(float knownValue | knownValue = cast.getValue().toFloat()) and
208208
instr.getUnconvertedResultExpression() = cast and
209209
boundedInstruction(instr, b, delta, true, _) and // true = upper bound
210-
upperBound(b.getInstruction().getUnconvertedResultExpression()) + delta <=
210+
upperBound(b.getInstruction().getUnconvertedResultExpression().getExplicitlyConverted()) + delta <=
211211
typeUpperBound(toType)
212212
)
213213
}

0 commit comments

Comments
 (0)