...
This rule appears in the C++ Secure Coding Standard as INT32-CPP. Ensure that operations on signed integers do not result in overflow.
This rule appears in the Java Secure Coding Standard as INT34-J. Perform explicit range checking to ensure integer operations do not overflow.
References
Wiki Markup |
---|
\[[Dowd 06|AA. C References#Dowd 06]\] Chapter 6, "C Language Issues" (Arithmetic Boundary Conditions, pp. 211-223) \[[ISO/IEC 9899:1999|AA. C References#ISO/IEC 9899-1999]\] Section 6.5, "Expressions," and Section 7.10, "Sizes of integer types <limits.h>" \[[ISO/IEC PDTR 24772|AA. C References#ISO/IEC PDTR 24772]\] "XYY Wrap-around Error" \[[MITRE 07|AA. C References#MITRE 07]\] [CWE ID 129|http://cwe.mitre.org/data/definitions/129.html], "Unchecked Array Indexing" and [CWE ID 190|http://cwe.mitre.org/data/definitions/190.html], "Integer Overflow (Wrap or Wraparound)" \[[Seacord 05|AA. C References#Seacord 05]\] Chapter 5, "Integers" \[[Viega 05|AA. C References#Viega 05]\] Section 5.2.7, "Integer overflow" \[[VU#551436|AA. C References#VU551436]\] \[[Warren 02|AA. C References#Warren 02]\] Chapter 2, "Basics" |
...