This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libobjc/61332] libobjc unsafe malloc use instead objc_malloc
- From: "max at cert dot cx" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 May 2014 23:14:57 +0000
- Subject: [Bug libobjc/61332] libobjc unsafe malloc use instead objc_malloc
- Auto-submitted: auto-generated
- References: <bug-61332-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61332
--- Comment #2 from Maksymilian A <max at cert dot cx> ---
It seems that we have two problems here:
1 The first is memory allocation without GC_malloc (when GC used)
2 If OBJC_WITH_GC is not definied, objc_malloc() also check result of malloc()
-----
objc_malloc (size_t size)
{
void *res = (void *)(malloc (size));
if (! res)
_objc_abort ("Virtual memory exhausted\n");
return res;
}
-----
related to
https://www.securecoding.cert.org/confluence/display/cplusplus/EXP34-CPP.+Ensure+a+null+pointer+is+not+dereferenced
Thank you for your attention
Maksymilian Arciemowicz
http://cifrex.org