Good General Practices
use new and delete instead of malloc and free
do not use ?:
if a func has no parameters, use () instead of (void)
do not use goto
avoid declaring member variable with 'mutable' keyword
avoid declaring local variables with 'register' keyword
avoid declaring local variables with 'static' keyword
avoid do statements - potential endless loops
look for unusual and pertinent keywords
consistency is nice but not mandated
provide if with else
|
Good Security Practices
the bad fixed keywords are shown elsewhere
terminate case with break;
for each switch, provide default:
default: with security critical data should transfer to SwError
if else sequences with security critical data terminate in SwError
s_ files with if else sequences in many cases terminate in SwError
terminate other as identified if else sequences with SwError
look for undefined error codes in SwError
look for multiple uses of the same error codes
malloc should not be used on security critical data
if malloc is used on security critical data crypto zeroize before free
|