CTR55-CPP
: Consider iter != last
to be a bounds check
#374
Labels
Difficulty-Medium
A false positive or false negative report which is expected to take 1-5 days effort to address
false positive/false negative
An issue related to observed false positives or false negatives.
Impact-Medium
Phase II
user-report
Issue reported by an end user of CodeQL Coding Standards
Affected rules
CTR55-CPP
Description
This query has a fairly restricted view of what a valid bounds check consists of. Consider expanding to support
iter != last
as a valid bound check, iflast
is derived fromend()
. We should also consider the case of utility methods on iterators, and whether they are correct at the call site.Example
for (; iter != end; ++iter) { }
The text was updated successfully, but these errors were encountered: