CodeQL library for C/C++
codeql/cpp-all 0.12.10 (changelog, source)
Search

Predicate convertedExprMightOverflowPositively

Holds if the expression might overflow positively. Conversions are also taken into account. For example the expression (int16)(x+y) might overflow due to the (int16) cast, rather than due to the addition.

Import path

import semmle.code.cpp.rangeanalysis.new.SimpleRangeAnalysis
predicate convertedExprMightOverflowPositively(Expr expr)