Re:This is the exploit equivalent of that guy who played the...
by dbenamy on Monday July 06, 2009 @08:54PM
(#690725)
That's probably the same as the non-assert check EXCEPT that release builds might disable assertions and then you're in trouble.
Re:This is the exploit equivalent of that guy who played the...
by basugasubaku on Tuesday July 07, 2009 @12:40AM
(#690935)
Right. Plus as a matter of style, assertions are traditionally distinguished from error handling. Assertions are used to catch programmer errors; error handling is for when something happens that is nevertheless within the contract of the library (malloc can return NULL, fopen can return NULL, etc).
Out of curiosity, I have always used assert to do malloc null checks. I realize it is just a macro which gives a conditional to exit but is at all hindering in terms of performance?
eg: