Versions Compared

Key

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

...

Misunderstanding integer conversion rules can lead to errors, which in turn can lead to exploitable vulnerabilities. The major risks occur when narrowing the type (which requires a specific cast or assignment), converting from unsigned to signed, or converting from negative to unsigned.

...

Tool

Version

Checker

Description

LDRA tool suite

Include Page
LDRA_V
LDRA_V

52 S
93 S
96 S
101 S
332 S
334 S
433 S
434 S
442 S
443 S
446 S
452 S
457 S
458 S
491 S

Fully implemented

PRQA QA-C
Include Page
PRQA_V
PRQA_V
 

0290
0291
3755
3756
3757
3758
3759
3760
3762
3763
3764
3765

Fully implemented

Related Vulnerabilities

...

ISO/IEC 9899:2011 Section 6.3, "Conversions"

ISO/IEC TR 24772 "FLC Numeric conversion errors"

MISRA Rules 10.1, 10.3, 10.5, and 12.9

...

MITRE CWE: CWE-197, "Numeric truncation error"

Bibliography

[Dowd 2006] Chapter 6, "C Language Issues" ("Type conversions," pp. 223–270)
[Seacord 2005a] Chapter 5, "Integers"

...