Re:Reading the NSA’s codebase: LemonGraph review
by kieckerjan on Friday August 10, 2018 @02:02PM
(#17735491)
Eh? When did that get started? You are claiming resources. Not checking if you got them is a leap of faith, period. If nothing else, you can abort the program before nastier things happen.
[ Parent
| on HN ]
Re:Reading the NSA’s codebase: LemonGraph review
by flafla2 on Friday August 10, 2018 @07:10PM
(#17737342)
This is correct. What happens when you are trying to rely on malloc'd memory for sensitive calculations? Reading an invalid pointer is undefined behavior. I see no reason why "it almost never works" to check for NULL and abort if necessary.
> Checking the return of malloc() for NULL is not currently considered good practice
This is simply false. I was a TA for the intro C class at CMU last year, and we still teach to check for NULL. In fact, we mark down students who do not do so.