Skip to content

Commit 6912caf

Browse files
committed
C++: Use the RelationalOperation class
1 parent 0d0ab91 commit 6912caf

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cpp/ql/src/semmle/code/cpp/security/TaintTracking.qll

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,7 @@ GlobalOrNamespaceVariable globalVarFromId(string id) {
330330
* A variable that has any kind of upper-bound check anywhere in the program
331331
*/
332332
private predicate hasUpperBoundsCheck(Variable var) {
333-
exists(BinaryOperation oper, VariableAccess access |
334-
(
335-
oper.getOperator() = "<" or
336-
oper.getOperator() = "<=" or
337-
oper.getOperator() = ">" or
338-
oper.getOperator() = ">="
339-
) and
333+
exists(RelationalOperation oper, VariableAccess access |
340334
oper.getLeftOperand() = access and
341335
access.getTarget() = var and
342336
// Comparing to 0 is not an upper bound check

0 commit comments

Comments
 (0)