...
| Code Block | ||||
|---|---|---|---|---|
| ||||
FILE *file; char *file_name; /* initializeInitialize file_name */ file = fopen(file_name, "w+"); if (file == NULL) { /* Handle error condition */ } if (unlink(file_name) != 0) { /* Handle error condition */ } /*... continueContinue performing I/O operations on file ...*/ fclose(file); |
...
Calling remove() on an open file has different implications for different implementations and may cause abnormal termination if the removed file is written to or read from, or it may result in unintended information disclosure from files not deleted as intended.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
FIO08-C | mediumMedium | probableProbable | highHigh | P4 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
|
|
| |||||||
| 81 D | Fully implemented | |||||||
| PRQA QA-C |
| Warncall -wc remove | Partially implemented |
...