...
| Code Block | ||||
|---|---|---|---|---|
| ||||
#include <string.h>
void func(const char *src) {
/* validateValidate the source string, calculate size. */
char *dest;
/* malloc destination string */
memcpy(dest, src,
#ifdef PLATFORM1
12
#else
24
#endif
/* ... */
);
|
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
#include <string.h>
void func(const char *src) {
/* validateValidate the source string, calculate size. */
char *dest;
/* malloc destination string */
#ifdef PLATFORM1
memcpy(dest, src, 12);
#else
memcpy(dest, src, 24);
#endif
} |
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
PRE32-C | lowLow | unlikelyUnlikely | mediumMedium | P2 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| CC2.PRE32 | Fully implemented |
...