Chapter 7. Carefully Call Out to Other Resources

 

Do not put your trust in princes, in mortal men, who cannot save.

  Psalms 146:3 (NIV)
Table of Contents
7.1. Call Only Safe Library Routines
7.2. Limit Call-outs to Valid Values
7.3. Call Only Interfaces Intended for Programmers
7.4. Check All System Call Returns
7.5. Avoid Using vfork(2)
7.6. Counter Web Bugs When Retrieving Embedded Content
7.7. Hide Sensitive Information

Practically no program is truly self-contained; nearly all programs call out to other programs for resources, such as programs provided by the operating system, software libraries, and so on. Sometimes this calling out to other resources isn't obvious or involves a great deal of ``hidden'' infrastructure which must be depended on, e.g., the mechanisms to implement dynamic libraries. Clearly, you must be careful about what other resources your program trusts and you must make sure that the way you send requests to them.