News for hackers. Stuff that matters.
Re:This is the exploit equivalent of that guy who played the... by jacquesm on Monday July 06, 2009 @08:04PM (#690680)
Checking your return values is pretty essential stuff. The error in this case was not checking that malloc could return null and then not to abort.

So, if you call malloc and do not check the return value (and abort if it is NULL) then you end up using the 'null' pointer. Normally this will cause your application to crash since a null pointer can not be dereferenced. But if the null pointer is used with an offset and that offset is under the control of the attacker then suddenly you can access pretty much all of memory. (of course, if the pointer would have been valid and you can combine it with arbitrary input you can STILL access all of memory but it is a lot harder to figure out where you are pointing, a null pointer literally contains '0' so all you have to do is figure out where you want to be, not where the pointer is pointing, you already know that).

The overhead of checking what malloc returns you is trivial compared to what malloc does internally so I wouldn't worry about that at all.

There are no comments on this comment yet.