...
A divide-by-zero can result in abnormal program termination and denial of service.
Recommendation Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
NUM19 INT33-J CPP | low | likely | medium | P6 | L2 |
Automated Detection
Automated detection exists for C and C++, but not for Java yet.
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Other Languages
This rule appears in the C Secure Coding Standard as INT33-C. Ensure that division and modulo operations do not result in divide-by-zero errors.
CERT C++ Secure Coding Standard: INT33-CPP. Ensure that division and modulo operations do not result in divide-by-zero errors
Bibliography
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0930130b-cb91-4b1f-91c6-781c60d9b560"><ac:plain-text-body><![CDATA[ | [[ISO/IEC 9899:1999 | AA. Bibliography#ISO/IEC 9899-1999]] | Section 6.5.5, "Multiplicative operators" | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="801ffff9-2f2f-4f83-bc7c-bbf750a74a7f"><ac:plain-text-body><![CDATA[ | [[MITRE 07 | AA. Bibliography#MITRE 07]] | [CWE ID 369 | http://cwe.mitre.org/data/definitions/369.html], "Divide By Zero" | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="68deabf7-6d14-45dc-b8d7-36a6565ddc36"><ac:plain-text-body><![CDATA[ | [[Seacord 05 | AA. Bibliography#Seacord 05]] | Chapter 5, "Integers" | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2eab5af3-e34c-4c95-90f4-0c698ce06db0"><ac:plain-text-body><![CDATA[ | [[Warren 02 | AA. Bibliography#Warren 02]] | Chapter 2, "Basics" | ]]></ac:plain-text-body></ac:structured-macro> |
...
NUM17-J. Beware of precision loss when converting primitive integers to floating-point 03. Numeric Types and Operations (NUM) 04. Object Orientation (OBJ)