 
                            Portability is an important issue to keep in mind when using the fread() and fwrite() functions across multiple systems. In particular, it is never guaranteed that reading or writing of simple data structures such as int's, let alone complex structures such as float's or struct's, will preserve the representation or value of the data. Different compilers use different amounts of padding, different . Different machines use various floating point models , and may use a different number of bits per byte. In addition, and there is always the issue of endianness.
...
The best solution is to use either a text representation or a special library which that will ensure the integrity of data.
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
References
| Wiki Markup | 
|---|
| \[[Summit 95|AA. C References#Summit 95]\], [20.5 on C-FAQ | http://c-faq.com/misc/binaryfiles.html] | 
...
FIO00-A. Take care when creating format strings 09. Input Output (FIO) FIO02-A. Canonicalize path names originating from untrusted sources