STR34-C
: Rule improvements
#577
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-High
Standard-CERT-C
Affected rules
STR34-C
Description
char
type - whether a type isconst
,volatile
etc. doesn't impact whether it's vulnerable to this bug.char
values are modified by the conversion to a larger signed integer.char
is unsigned by default. Currently we say we wantCharType
s but notUnsignedCharType
s, however that does not exclude the case wherechar
is unsigned. I think we want the equivalent ofc.getExpr().getType().(CharType).isSigned()
(notwithstanding the first point in the list about specifiers)(a >= 'A' && a <= ' F')
and similar. These are safe as long as the two constants are within the range[0..CHAR_MAX]
.tolower
) which often create multiple results, which can be confusing to the user.Example
The text was updated successfully, but these errors were encountered: