Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Few programmers consider the issues around formatted I/O and type definitions. A programmer-defined integer type might be any type supported by the implementation, even a type larger than unsigned long long. For example, given an implementation that supports 128-bit unsigned integers and provides a uint_fast128_t type, a programmer may define the following type:

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

INT15-C

highHigh

unlikelyUnlikely

mediumMedium

P6

L2

Automated Detection

Tool

Version

Checker

Description

Compass/ROSE

 

 

Can catch violations of this rule by scanning the printf() and scanf() family of functions. For each such function, any variable that corresponds to a %d qualifier (or any qualifier besides %j) and that is not one of the built-in types (char, short, int, long, long long) indicates a violation of this rule. To catch violations, ROSE would also have to recognize derived types in expressions, such as size_t

LDRA tool suite

Include Page
LDRA_V
LDRA_V

439 S
440 S
586 S

Partially implemented

...