In This Chapter
An Introduction to Code Hardening
Code Hardening Techniques
Tools Support for Code Hardening
Tracing Binary Applications
The practice of code hardening (or defensive programming) is a useful technique to increase the quality and reliability of software. The practice entails anticipating where errors can occur in our code and then writing that code in a way that either avoids them altogether or identifies them immediately so that their source can be more easily tracked. Since C is not a safe language, some methods have proven invaluable to help build more reliable programs, which we ll detail here.
This chapter will cover a number of techniques under the umbrella of code hardening, all of which can be applied immediately. Since the benefits are clear, let s jump right into this chapter. We ll look at a variety of code-hardening methods, as well as tool-based techniques such as using the compiler or open source tools to help build secure and reliable GNU/Linux applications.