GitHub
CERT Secure Coding

Error Handling (ERR)

Information for Editors
In order to have a new guideline automatically listed above be sure to label it err and recommendation .

Risk Assessment Summary

Rule Severity Likelihood Detectable Repairable Priority Level
ERR00-C Medium Probable No No P4 L3
ERR01-C Low Probable Yes Yes P6 L2
ERR02-C Low Unlikely No No P1 L3
ERR04-C Medium Probable No No P4 L3
ERR05-C Medium Probable Yes No P8 L2
ERR06-C Medium Unlikely No No P2 L3
ERR07-C Medium Probable Yes Yes P12 L1
DCL09-C. Declare functions that return errno with a return type of errno_t
FIO40-C. Reset strings on fgets() or fgetws() failure
FLP03-C. Detect and handle floating-point errors
FLP32-C. Prevent or detect domain and range errors in math functions
MSC11-C. Incorporate diagnostic tests using assertions
VOID Always check for errors when using threads
VOID FIO04-C. Detect and handle input and output errors
void FIO33-C. Detect and handle input output errors resulting in undefined behavior
void FIO34-C. Use int to capture the return value of character IO functions that might be used to check for end of file
void FIO35-C. Use feof() and ferror() to detect end-of-file and file errors when sizeof(int) == sizeof(char)
void MEM32-C. Detect and handle memory allocation errors