CERT® C Coding Standard, Second Edition, The: 98 Rules for Developing Safe, Reliable, and Secure Systems (SEI Series in
“At Cisco, we have adopted the CERT C Coding Standard as the internal secure coding standard for all C developers. It is a core component of our secure development lifecycle. The coding standard described in this book breaks down complex software security topics into easy-to-follow rules with excellent real-world examples. It is an essential reference for any developer who wishes to write secure and resilient software in C and C++.”
—Edward D. Paradise, vice president, engineering, threat response, intelligence, and development, Cisco Systems
Secure programming in C can be more difficult than even many experienced programmers realize. To help programmers write more secure code, The CERT® C Coding Standard, Second Edition, fully documents the second official release of the CERT standard for secure coding in C. The rules laid forth in this new edition will help ensure that programmers’ code fully complies with the new C11 standard; it also addresses earlier versions, including C99.
The new standard itemizes those coding errors that are the root causes of current software vulnerabilities in C, prioritizing them by severity, likelihood of exploitation, and remediation costs. Each of the text’s 98 guidelines includes examples of insecure code as well as secure, C11-conforming, alternative implementations. If uniformly applied, these guidelines will eliminate critical coding errors that lead to buffer overflows, format-string vulnerabilities, integer overflow, and other common vulnerabilities.
This book reflects numerous experts’ contributions to the open development and review of the rules and recommendations that comprise this standard.
Coverage includes
- Preprocessor
- Declarations and Initialization
- Expressions
- Integers
- Floating Point
- Arrays
- Characters and Strings
- Memory Management
- Input/Output
- Environment
- Signals
- Error Handling
- Concurrency
- Miscellaneous Issues
Why Read This Book
You should read this book if you write C for embedded systems and want a concise, actionable set of rules to reduce security and reliability defects. It gives 98 concrete rules with rationale and examples so you can spot dangerous patterns, choose safer alternatives, and justify coding decisions to peers or auditors.
Who Will Benefit
Embedded/firmware engineers and systems programmers who develop C code for resource-constrained or safety/security-sensitive devices and want to harden their codebase.
Level: Intermediate — Prerequisites: Comfortable with C programming (pointers, arrays, the standard library) and basic systems concepts; familiarity with compiler warnings and basic debugging tools will help apply the rules.
Key Takeaways
- Avoid common memory-safety vulnerabilities such as buffer overflows and use-after-free errors
- Identify and eliminate undefined and implementation-defined behavior that can break portability and security
- Replace unsafe library and language constructs with safer, well-documented alternatives or wrappers
- Apply consistent input validation, error handling, and resource management patterns to reduce faults
- Use static and dynamic analysis tools effectively and interpret their results to find real defects
- Design and document coding practices so security rules are enforceable and maintainable across teams
Topics Covered
- Introduction: Goals, Scope, and How to Use the Standard
- Secure Development Principles and Coding Strategy
- Preprocessor and Macros
- Types, Conversions, and Integer Arithmetic
- Pointers and Memory Access
- Arrays and Strings
- Dynamic Memory Management
- Input/Output and File Handling
- Error Handling and Resource Management
- Concurrency and Thread Safety (where applicable)
- Testing, Static/Dynamic Analysis, and Tooling
- Appendices: Rule Index, Rationale, and Examples
Languages, Platforms & Tools
How It Compares
Covers similar ground to MISRA C in preventing dangerous language features, but CERT C emphasizes security-focused rules, practical examples, and rationale rather than the strict, industry-specific compliance style of MISRA.













