...
Passing improperly aligned pointers or pointers to insufficient storage to placement new expressions can result in undefined behavior, including buffer overflow and abnormal termination.
Rule | Severity | Likelihood | Detectable | RepairableRemediation Cost | Priority | Level |
|---|---|---|---|---|---|---|
MEM54-CPP | High | Likely | No | NoMedium | P18P9 | L1 L2 |
Automated Detection
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Axivion Bauhaus Suite |
| CertC++-MEM54 | |||||||
| CodeSonar |
| LANG.MEM.BO | Buffer Overrun | ||||||
| Helix QAC |
| C++3119, C++3128, DF3520, DF3521, DF3522, DF3523 | |||||||
| Klocwork |
| CERT.MEM.PLACEMENTNEW.MISALIGNED | |||||||
| LDRA tool suite |
| 597 S | Enhanced Enforcement | ||||||
| Parasoft C/C++test |
| CERT_CPP-MEM54-a | Do not pass a pointer that has insufficient storage capacity or that is not suitably aligned for the object being constructed to placement 'new' | ||||||
| Polyspace Bug Finder |
| CERT C++: MEM54-CPP | Checks for placement new used with insufficient storage or misaligned pointers (rule fully covered) | ||||||
| PVS-Studio |
| V752 |
...