Query module BadAdditionOverflowCheck

name
Bad check for overflow of integer addition
description
Checking for overflow of integer addition by comparing against one of the arguments of the addition does not work when the result of the addition is automatically promoted to a larger type.
kind
problem
problem.severity
error
precision
very-high
id
cpp/bad-addition-overflow-check
tags
reliability correctness security external/cwe/cwe-190 external/cwe/cwe-192

Imports

BadAdditionOverflowCheck

Provides the implementation of the BadAdditionOverflowCheck query. The query is implemented as a library, so that we can avoid producing duplicate results in other similar queries.

cpp

Provides classes and predicates for working with C/C++/ObjC/ObjC++ code.