LWN.net Logo

CERT C Secure Coding Standard: last call for reviewers

CERT C Secure Coding Standard: last call for reviewers

Posted Mar 14, 2008 23:45 UTC (Fri) by nix (subscriber, #2304)
In reply to: CERT C Secure Coding Standard: last call for reviewers by ajross
Parent article: CERT C Secure Coding Standard: last call for reviewers

Actually I was just saved a pile of debugging by this rule. I religiously 
check for allocation failures, and actually have a bunch of macros to 
assist: they provide a crude C exception-unwinding/deallocate-on-failure 
facility, too, but most importantly they enable me to *distinguish* 
between failure sites.

In this specific case the allocation failure was *right* at the place 
where a huge leak was happening (as is likely when the leak is huge: a bit 
of dmallocing and all the other leaks were fixed, too). Without error 
trapping, all I'd have got would have been a core dump, and as the failure 
happened on a live site which won't let us see core dumps because they 
might well contain confidential data, I'd have been stuffed.


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds