
...
Comparing padding bytes, when present, can lead to unexpected program behavior.
Rule | Severity | Likelihood | Detectable | RepairableRemediation Cost | Priority | Level |
---|---|---|---|---|---|---|
EXP42-C | Medium | Probable | Yes | YesMedium | P8P12 | L2L1 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Astrée |
| memcpy-with-padding | Partially checked | ||||||
Axivion Bauhaus Suite |
| CertC-EXP42 | |||||||
CodeSonar |
| BADFUNC.MEMCMP | Use of memcmp | ||||||
Cppcheck Premium |
| premium-cert-exp42-c | |||||||
Helix QAC |
| DF4726, DF4727, DF4728, DF4729 | |||||||
Klocwork |
| MISRA.STDLIB.MEMCMP.PTR_ARG_TYPES | |||||||
LDRA tool suite |
| 618 S | Partially implemented | ||||||
Parasoft C/C++test |
| CERT_C-EXP42-a | Don't memcpy or memcmp non-PODs | ||||||
PC-lint Plus |
| 958, 959 | Assistance provided: reports structures which require padding between members or after the last member | ||||||
| Checks for memory comparison of padding data (rule fully covered) | ||||||||
PVS-Studio |
| V1103 | |||||||
RuleChecker |
| memcpy-with-padding | Partially checked | ||||||
TrustInSoft Analyzer |
| comparable_char_blocks | Exhaustively verified (see the compliant and the non-compliant example). |
...