Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Wiki MarkupC99 defines the {{fwrite()}} function as follows \[ [ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\]:

size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);

The fwrite() function shall write, from the array pointed to by ptr, up to nitems elements whose size is specified by size, to the stream pointed to by stream. For each object, size calls shall be made to the fputc() function, taking the values (in order) from an array of unsigned char exactly overlaying the object. The file-position indicator for the stream (if defined) shall be advanced by the number of bytes successfully written. If an error occurs, the resulting value of the file-position indicator for the stream is unspecified.

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

FIO18-C

Medium

Probable

Medium

P8

L2

Related Guidelines

CERT C++ Secure Coding Standard: FIO18-CPP. Never expect write() to terminate the writing process at a null character

...