Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
langc
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

Compass/ROSE

 

 

 

LDRA tool suite

Include Page
LDRA_V
LDRA_V

81 D

Fully implemented

PRQA QA-C
Include Page
PRQA_V
PRQA_V
Warncall -wc removePartially implemented

...