...
Code Block | ||
---|---|---|
| ||
int main(int argc, char const char *argv[]) { char *buff; buff = (char *)malloc(BUFSIZE); if (!buff) { /* handle error condition */ } /* ... */ free(buff); /* ... */ strncpy(buff, argv[1], BUFSIZE-1); } |
...
Code Block | ||
---|---|---|
| ||
int main(int argc, char const char *argv[]) { char *buff; buff = (char *)malloc(BUFSIZE); if (!buff) { /* handle error condition */ } /* ... */ strncpy(buff, argv[1], BUFSIZE-1); /* ... */ free(buff); } |
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
MEM30-C | 3 ( high ) 3 ( | likely ) | 2 ( medium ) | P18 | L1 |
Automated Detection
The LDRA tool suite V 7.6.0 is able to detect violations of this rule.
...