Versions Compared

Key

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

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

FIO42-C

Medium

Unlikely

Medium

P4

L3

Automated Detection

This rule is stricter than rule [fileclose] in ISO/IEC TS 17961:2013. Analyzers that conform to the technical standard may not detect all violations of this rule.

...

Taxonomy

Taxonomy item

Relationship

CERT CFIO51-CPP. Close files when they are no longer neededPrior to 2018-01-12: CERT: Unspecified Relationship
CERT Oracle Secure Coding Standard for JavaFIO04-J. Release resources when they are no longer neededPrior to 2018-01-12: CERT: Unspecified Relationship
ISO/IEC TS 17961:2013Failing to close files or free dynamic memory when they are no longer needed [fileclose]Prior to 2018-01-12: CERT: Unspecified Relationship
CWE 2.11CWE-404, Improper Resource Shutdown or Release2017-07-06: CERT: Rule subset of CWE
CWE 2.11CWE-4592017-07-06: CERT: Rule subset of CWE
CWE 2.11CWE-7722017-07-06: CERT: Rule subset of CWE
CWE 2.11CWE-7732017-07-06: CERT: Rule subset of CWE
CWE 2.11CWE-7752017-07-06: CERT: Rule subset of CWE
CWE 2.11CWE-403

2017-10-30:MITRE:Unspecified Relationship

2018-10-18:CERT:Partial overlap

CERT-CWE Mapping Notes

Key here for mapping notes

...

  • Failure to free resources besides files or memory chunks, such as mutexes)

CWE-403 and FIO42-C

CWE-403 FIO42-C = list, where list =

  • A process opens and closes a sensitive file descriptor, but also executes a child process while the file descriptor is open.

FIO42-C - CWE-403 = SPECIAL_CASES, where SPECIAL_CASES =

  • A program opens a file descriptor and fails to close it, but does not invoke any child processes while the file descriptor is open.

...