This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libobjc/61332] libobjc unsafe malloc use instead objc_malloc


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]