Versions Compared

Key

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

...

Code Block
bgColor#ccccff
/* ... */
FILE *fptr;
errno_t res = fopen_s(&fptr, file_name, "w");
if (res != 0) {
  /* Handle Error */
}
/* ... */

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

FIO06-A

2 (medium)

1 (unlikely)

2 (medium)

P4

L3

Related Vulnerabilities

Search for Examples of vulnerabilities resulting from the violation of this recommendation can be found rule on the CERT website.

References

Wiki Markup
\[[ISO/IEC 9899-1999|AA. C References#ISO/IEC 9899-1999]\] Section 7.19.5.3, "The fopen function"
\[[Open Group 04|AA. C References#Open Group 04]\] "The open function," "The umask function"
\[[ISO/IEC TR 24731-2006|AA. C References#SO/IEC TR 24731-2006]\] Section 6.5.2.1, "The fopen_s function"
\[[Viega 03|AA. C References#Viega 03]\] Section 2.7,  "Restricting Access Permissions for New Files on Unix"
\[[Dowd 06|AA. C References#Dowd 06]\] Chapter 9, "UNIX 1: Privileges and Files"