Title: INT10-C. Do not assume a positive remainder when using the % operator  
Author: Robert Seacord Sep 26, 2007
Last Changed by: Michal Rozenau Jun 12, 2023
Tiny Link: (useful for email) https://wiki.sei.cmu.edu/confluence/x/_NUxBQ
Export As: Word · PDF  
Hierarchy
Parent Page
    Page: Rec. 04. Integers (INT)
Outgoing Links
External Links (11)
    https://www.mathworks.com/help/bugfinder/ref/certcrec.int10…
    cwe.mitre.org/
    https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
    cwe.mitre.org/data/definitions/682.html
    msdn2.microsoft.com/en-us/library/efa0csed%28VS.80%29.aspx
    cwe.mitre.org/data/definitions/129.html
    https://www.kb.cert.org/vulnotes/bymetric?searchview&query=…
    https://www.securecoding.cert.org/confluence/display/seccod…
    docs.sun.com/source/819-3688/c90.implementation.app.html
    https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
    https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
SEI CERT C++ Coding Standard (2)     Page: VOID INT10-CPP. Do not assume a positive remainder when using the % operator
    Home page: SEI CERT C++ Coding Standard
SEI CERT Oracle Coding Standard for Java (2)     Home page: SEI CERT Oracle Coding Standard for Java
    Page: NUM02-J. Ensure that division and remainder operations do not result in divide-by-zero errors
SEI CERT C Coding Standard (15)     Page: ERR02-C. Avoid in-band error indicators
    Page: LDRA
    Page: Rose
    Page: LDRA_V
    Page: Polyspace Bug Finder
    Page: Parasoft
    Page: Parasoft_V
    Page: INT32-C. Ensure that operations on signed integers do not result in overflow
    Page: AA. Bibliography
    Page: Polyspace Bug Finder_V
    Page: BB. Definitions
    Page: Helix QAC_V
    Home page: SEI CERT C Coding Standard
    Page: Helix QAC
    Page: INT01-C. Use rsize_t or size_t for all integer values representing the size of an object