Integers (INT)
- INT00-C. Understand the data model used by your implementation(s)
- INT01-C. Use size_t or rsize_t for all integer values representing the size of an object
- INT02-C. Understand integer conversion rules
- INT04-C. Enforce limits on integer values originating from tainted sources
- INT05-C. Do not use input functions to convert character data if they cannot handle all possible inputs
- INT07-C. Use only explicitly signed or unsigned char type for numeric values
- INT08-C. Verify that all integer values are in range
- INT09-C. Ensure enumeration constants map to unique values
- INT10-C. Do not assume a positive remainder when using the % operator
- INT12-C. Do not make assumptions about the type of a plain int bit-field when used in an expression
- INT13-C. Use bitwise operators only on unsigned operands
- INT14-C. Avoid performing bitwise and arithmetic operations on the same data
- INT15-C. Use intmax_t or uintmax_t for formatted IO on programmer-defined integer types
- INT16-C. Do not make assumptions about representation of signed integers
- INT17-C. Define integer constants in an implementation-independent manner
- INT18-C. Evaluate integer expressions in a larger size before comparing or assigning to that size
Information for Editors
To have a new guideline automatically listed above be sure to label it int and recommendation .
Risk Assessment Summary
Rule | Severity | Likelihood | Detectable | Repairable | Priority | Level |
|---|---|---|---|---|---|---|
| INT00-C | High | Unlikely | No | No | P3 | L3 |
| INT01-C | Medium | Probable | No | Yes | P8 | L2 |
| INT02-C | Medium | Probable | No | No | P4 | L3 |
| INT04-C | High | Probable | Yes | No | P12 | L1 |
| INT05-C | Medium | Probable | Yes | No | P8 | L2 |
| INT07-C | Medium | Probable | Yes | Yes | P12 | L1 |
| INT08-C | Medium | Probable | No | No | P4 | L3 |
| INT09-C | Low | Probable | Yes | No | P4 | L3 |
| INT10-C | High | Unlikely | No | No | P3 | L3 |
| INT12-C | Low | Unlikely | No | No | P1 | L3 |
| INT13-C | High | Unlikely | Yes | No | P6 | L2 |
| INT14-C | Medium | Unlikely | Yes | No | P4 | L3 |
| INT15-C | High | Unlikely | No | Yes | P6 | L2 |
| INT16-C | Medium | Unlikely | No | No | P2 | L3 |
| INT17-C | High | Probable | No | No | P6 | L3 |
| INT18-C | High | Likely | No | Yes | P18 | L1 |


